VB.NET 9 / VS 2008 - Array Literal?
Is there an array literal in VB.NET 9/ VS2008? Something like this pseudo-code:
Dim MyArray = {"e1", "e2", "e3"}
Or maybe some list that can be created instantly (pseudo-code):
Dim MyList = List("e1", "e2开发者_如何学C", "e3")
Dim MyArray = New Integer() { 1, 2, 3 }
' Or
Dim MyArray() As Integer = { 1, 2, 3 }
' Or
Dim MyArray() = { 1, 2, 3 }
' Or
Dim MyArray() = { 1, 2, "A", "B" }
All work equally well. If you choose the third one, it will infer the type and give you the correct type of array (integer in this case). The fourth one will give you an object array.
精彩评论