VB.Net program to demonstrate the Union() LINQ extension method
'VB.NET program to demonstrate the
'Union() LINQ extension method.
Module Module1
Sub Main()
Dim intList1 = New List(Of Integer) From {101, 102, 103, 104, 105, 106}
Dim intList2 = New List(Of Integer) From {201, 202, 103, 104, 205, 206}
Dim result = intList1.Union(intList2)
Console.WriteLine("Results:")
For i = 0 To result.Count() - 1 Step 1
Console.Write(result.ElementAt(i) & " ")
Next
Console.WriteLine()
End Sub
End Module
Results:
101 102 103 104 105 106 201 202 205 206
Press any key to continue . . .
Table of Contents