SyntaxBomb - Indie Coders
Languages & Coding => Monkey => Topic started by: jvdw007 on March 28, 2019, 21:58:44
As the title says, I'm trying to split a long string from a csv file by the line breaks.
Looked at the example banana files and the older monkey docs but not finding anything that says how to use special chars like line breaks.
Tried thestring.split("\r\n"), thestring.split(chr(10)) (and other variants like chr$(10) char$(10) etc and none work.
If this is not possible, maybe I can read the file in line-by-line instead I guess?
Thanks,
Jaco
There is not just "\r\n" - maybe have a closer look in Notepad++ (or so) and let you display line endings so you see if it is CR/LF or just LF or ...
In BlitzMax the newline char is escaped as "~n" - assume this is the same in Monkey-X/Cerberus.
bye
Ron
Hey Ron,
Thanks a load for that. I never used blitzmax so wasn't aware. Saying that, I tried it and it worked! Happy days! ^-^
I usually first try: String.Replace("~r","").Split("~n")
Thanks for the tip GW!