Mega Code Archive

 
Categories / VB.Net / Data Structure
 

Create List(Of T) class that contains elements copied from the specified collection

Imports System Imports System.Collections.Generic Public Class Example     Public Shared Sub Main()         Dim input() As String = { "One","Two","Three" }         Dim numbers As New List(Of String)(input)         Console.WriteLine(vbLf & "Capacity: {0}", numbers.Capacity)         For Each num As String In numbers             Console.WriteLine(num)         Next     End Sub End Class