Load multiline textbox into an array

Bone_Jack

New member
Joined
Apr 3, 2006
Messages
2
Programming Experience
1-3
Hi, I am trying to load the contents of a multiline textbox into a string array and cant figure out why it is not working. I thought I would be able to use the SPLIT function like this:

Dim
strarray() As String
strarray = Split(txtCourses.Text, Environment.NewLine)

But that doesn't seem to work. All of the lines of the textbox are just added to the first index of the array separated by a symbol that looks similar to this []. What am I doing wrong?

Thanks,
Bone_Jack
 
'Class level variable
'Dim StrArray() as string

On the click of a button or somthing....

Redim StrArray(textbox.lines.getupperbound(0))

for i as integer = 0 to textbox.lines.getupperbound(0)
if textbox.lines.length>0 then
strarray(i) = textbox.lines(i)
end if
next
 
Back
Top