genespos
genespos

Reputation: 3311

Setting values of multidimensional array on "Dim" in vb.net

In VBA I can set the values of a multidimensional array this way:

mArr = [{"1", "Hello"; "World",  "I"; "am", "Sam"}]

How can I do this in vb.net?

I mean something like (not working):

Dim mArr() As String From  [{"1", "Hello"; "World",  "I"; "am", "Sam"}]

Upvotes: 1

Views: 272

Answers (2)

shruti1810
shruti1810

Reputation: 4037

You can have it as:

Dim values(,) As String =
    New String(,) {{"1", "Hello"},
           {"World", "I"},
           {"am", "Sam"}}

Upvotes: 1

Shar1er80
Shar1er80

Reputation: 9041

A little research would go along way... https://msdn.microsoft.com/en-us/library/0sxy840k(v=vs.90).aspx

Dim startingScores(,) As Short = New Short(1, 1) {{10, 10}, {10, 10}}

Upvotes: 2

Related Questions