Inline list initialization in VB.NET

Boris Callens picture Boris Callens · Apr 13, 2010 · Viewed 117.1k times · Source

Possible Duplicate:
Collection initialization syntax in Visual Basic 2008?

How is the following C# code translated to VB.NET?

var theVar = new List<string>{"one", "two", "three"};

Answer

SLaks picture SLaks · Apr 13, 2010

Collection initializers are only available in VB.NET 2010, released 2010-04-12:

Dim theVar = New List(Of String) From { "one", "two", "three" }