-2

I'm trying to attach a text file with my data for an array Visual Basic, in Visual Studio 2012.

How do you deliminate new values in the array? I've tried new lines, commas, quotes and it still reads it all as

arrayname(0)

Tim Williams
  • 154,628
  • 8
  • 97
  • 125
aric8456
  • 129
  • 2
  • 11

2 Answers2

0

You probably need a split() function. How is the text file organized? Are all the values separated by newlines?

Dim arrayname() As String
Dim text_string As String

text_string = "whatever you need to import from text file"
arrayname() = Split(text_string, " ") 'example splitting using spaces

output:

arrayname(0) = "whatever"

arrayname(1) = "you"

...

Alex
  • 13
  • 3
0

I figured it out

 Dim Arrayname() As type = My.Resources.ResourceName.Split(Environment.NewLine)
aric8456
  • 129
  • 2
  • 11