Adding items to the List at creation time in VB.Net

Posted by Shaddix on Stack Overflow See other posts from Stack Overflow or by Shaddix
Published on 2010-04-13T08:59:47Z Indexed on 2010/04/13 9:02 UTC
Read the original article Hit count: 396

Filed under:
|
|

In c# I can initialize a List at creation time like

var list = new List<String>() {"string1", "string2"};

is there a similar thing in VB.Net? Currently I can do it like

Dim list As New List(Of String)
list.Add("string1")
list.Add("string2")
list.Add("string3")

but I want to avoid boring .Add lines

© Stack Overflow or respective owner

Related posts about c#-to-vb.net

Related posts about vb.net