I want to statically defin开发者_运维问答e a mapped array of strings like:
var dict = {cat:50, bat:10, rat:30};
and lookup values within it like:
MessageBox.Show( dict["cat"] )
Dim dict As New Dictionary(Of String, Integer)()
With dict
.Add("Cat", 50)
.Add("Bat", 10)
.Add("Rat", 30)
End With
In .NET 4.0:
Dim d As Dictionary(Of String, Integer) From
{{"cat", 50}, {"bat", 10}, {"rat",30 }}
精彩评论