How to add all the elements of a list to another list in VB.NET

1 Answer

0 votes
Imports System
Imports System.Collections.Generic

Class Program
    Public Shared Sub Main()
        Dim list1 As List(Of Integer) = New List(Of Integer) From {
            1,
            2,
            3
        }
        Dim list2 As List(Of Integer) = New List(Of Integer) From {
            4,
            5,
            6,
			7
        }
        list1.AddRange(list2)

        Console.WriteLine(String.Join(", ", list1))
    End Sub
End Class



' run:
'
' 1, 2, 3, 4, 5, 6, 7
'

 



answered Oct 16 by avibootz
...