How is the following translated in VB.net:
var theVar = new List<string>{"one", "two", "three"};
How is the following translated in VB.net:
var theVar = new List<string>{"one", "two", "three"};
Collection initializers are only available in VB.Net 2010, released yesterday:
Dim theVar = New List(Of String) From { "one", "two", "three" }
Use this syntax for VB.Net 2005/2008 compatibility:
Dim theVar As New List(Of String)(New String() {"one", "two", "three"})
Although the VB.Net 2010 syntax is prettier.