How to create a list with elements from an array in VB.NET

1 Answer

0 votes
Imports System
Imports System.Collections.Generic

Public Class Program
    Public Shared Sub Main()
        Dim array As Integer() = New Integer() {3, 9, 0, 5, 1}
		
        Dim list As List(Of Integer) = New List(Of Integer)(array)
		
        Console.WriteLine(String.Join(" ", list))
    End Sub
End Class





' run:
'
' 3 9 0 5 1
'

 



answered Mar 8, 2023 by avibootz

Related questions

...