[RESOLVED] Split Textbox values
Hi
I have an app that reads 2 colums of numbers from a .rtf textfile. The textfile is added to a textbox line by line in a counter. Now I want to split these values to 2 other textboxes. but I don't know how to proceed now. The .rtf textfile is 2 columns of data (imported from Excel), I need this format because it is a pointpair list for Zedgraph. If I use this code both number is added, theres no split:
Code:
Dim Str As String = txtTest.Text
Dim Space_Index As Integer
Space_Index = Str.IndexOf(" ")
'This is returning -1 seems theres no space? How can I split the 2 colums?
Dim NewStr As String = Str.Substring(Space_Index + 1, Str.Length - (Space_Index + 1))
Dim NewStr2 As String = Str.Substring(0, Str.Length - (Str.Length - Space_Index))
TextBox1.AppendText(NewStr & ControlChars.NewLine)
TextBox2.AppendText(NewStr2 & ControlChars.NewLine)
If the string is ex. "John Doe", the code works.
The values in the testtextbox looks to have many spaces between them, I guess that it's only the space from the Excel cell. Could need some help here.