Help with spaces in strings

  • Thread starter Thread starter Roshawn Dawson
  • Start date Start date
R

Roshawn Dawson

Hi,

I am trying to split a line into a string array. Here's the line of code that's troubling me:

Dim arLogLines As String() = strResult.Split(Convert.ToChar("\n"))


From what I can tell through debugging the code, everything before this line of code works
perfectly. When I get to this line, I get an error stating that the "String must be only one
character long."

What does it mean by this, and how can I remedy the problem?

Thanks,
Roshawn
 
Roshawn Dawson said:
Hi,

I am trying to split a line into a string array. Here's the line of code that's troubling me:

Dim arLogLines As String() = strResult.Split(Convert.ToChar("\n"))
I beleive you can do it like this if you're trying to split a line up on
spaces...
Dim arrLogLines as String() = split(strResult, " ")
(There's a split function - as well as the split method of the String class
which you are using.)
 
Back
Top