Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you create a New array in VB.NET? [duplicate]

Tags:

arrays

vb.net

Possible Duplicate:
VB.Net Initialising an array on the fly

This maybe a stupid question, but its got me exasperated. How do I declare a new array inline? Is this possible? I've tried all of the following and they all don't work.

myVar = {"a", "b", "c"}
myVar = Array(3)
myVar = Array("a", "b", "c")
myVar = New Array()
myVar = New Array(3)
myVar = New Array("a", "b", "c")
like image 422
Robin Rodricks Avatar asked Jun 13 '09 11:06

Robin Rodricks


1 Answers

Either

Dim strings = New String() {"a", "b", "c"}

or

Dim strings() As String = {"a", "b", "c"}

should work

like image 59
jitter Avatar answered Oct 24 '22 18:10

jitter