Posts: 96
Threads: 39
Joined: Sep 2011
Reputation:
0
Hello y'all
How can I read a certain line from a textbox?
Like I want to read the second line out of the 100.
Thanks
Posts: 1,006
Threads: 111
Joined: Jul 2010
Reputation:
1
To get the second line you would do something like this:
[code2=vbnet]Dim secondLineText As String = textbox.Text.Split(vbNewLine)(2)[/code2]
Hopefully this helps!
Posts: 96
Threads: 39
Joined: Sep 2011
Reputation:
0
But now it reads two lines;
An empty line
Line2
How can you remove that from it?
Posts: 1,006
Threads: 111
Joined: Jul 2010
Reputation:
1
Well, you would simply alter the code a little:
[code2=vbnet]Dim secondLineText As String = textbox.Text.Split(vbNewLine)(2).Remove(0,1)[/code2]