How to fill Dictionary(Of TKey, TValue) directly in VB.NET
is there any way to do the same in VB.NET?
Dictionary<int, string> myDict = new Dictionary<int, string>()
{
{ 2, "This" },
{ 1, "is" },
{ 5, "radio" 开发者_C百科},
{ 12, "clash" },
};
As stated in Marcel's comment above:
Dim myDict As New Dictionary(Of Integer, String) From _
{{1, "one"}, {2, "two"}, {3, "three"}}
精彩评论