Split function not working.....

  • Thread starter Thread starter Jay
  • Start date Start date
J

Jay

So I'm writting this software that talks to an IRC server; and occasionaly
IRC servers send back data two lines at a time with lines breaks inside.
For my own sanity I had been using the split funciton to break these lines
down to seperate ones and then process the server commands etc. However
lately the split funciton seems incapable of finding chr(10)+chr(13) and
wont split the lines. When I dump the data to a text file however and open
it in notepad, notepad recognizes the lines and seperates them.

What is going on and how can I fix it?
 
Jay said:
So I'm writting this software that talks to an IRC server; and
occasionaly IRC servers send back data two lines at a time with lines
breaks inside. For my own sanity I had been using the split funciton
to break these lines down to seperate ones and then process the
server commands etc. However lately the split funciton seems
incapable of finding chr(10)+chr(13) and wont split the lines. When
I dump the data to a text file however and open it in notepad,
notepad recognizes the lines and seperates them.

A newline in Windows is chr(13) & chr(10) not the other way around.

Use the ControlChars.CrLf or ControlChars.NewLine constants.
 
Oh Thank You, I thought I was going to loose my mind today :-)
| Jay wrote:
| > So I'm writting this software that talks to an IRC server; and
| > occasionaly IRC servers send back data two lines at a time with lines
| > breaks inside. For my own sanity I had been using the split funciton
| > to break these lines down to seperate ones and then process the
| > server commands etc. However lately the split funciton seems
| > incapable of finding chr(10)+chr(13) and wont split the lines. When
| > I dump the data to a text file however and open it in notepad,
| > notepad recognizes the lines and seperates them.
|
| A newline in Windows is chr(13) & chr(10) not the other way around.
|
| Use the ControlChars.CrLf or ControlChars.NewLine constants.
|
| --
| Sven Groot
|
| http://unforgiven.bloghorn.com
 
Back
Top