在VB.NET中的内联列表初始化[duplicate]

25 浏览
0 Comments

在VB.NET中的内联列表初始化[duplicate]

此问题已经有答案:

可能重复:

在Visual Basic 2008中的集合初始化语法?

如何将以下C#代码翻译为VB.NET?

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

admin 更改状态以发布 2023年5月22日
0
0 Comments

使用以下语法来兼容VB.NET 2005/2008:

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

虽然VB.NET 2010语法更美观。

0
0 Comments

\n\n集合初始化器仅在发布于2010年4月12日的VB.NET 2010中可用:

\n

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

0