+92 332 4229 857 99ProjectIdeas@Gmail.com

LINQ Concat() Method (Vb.net)



The following code shows you how to concatenate two arrays. We can do this using loop and concatenate both array indexes simultaneously. But through LINQ Concat() method we dont need loop. See the code below.







Dim intArr As Integer() = {2, 1, 2, 3, 7, 5, 10, 9}

Dim intArr2 As Integer() = {3, 5, 7, 2, 7, 5, 11, 19}

Dim query = intArr.Concat(intArr2)

    For Each i In query

       Console.Write(i.ToString() & " ")

    Next

Output of the program is:
2 1 2 3 7 5 10 3 5 7 2 7 5 11 19

0 comments: