Removing new line from strings

BlitzMax Forums/BlitzMax Programming/Removing new line from strings

Twinprogrammer(Posted 2015) [#1]
Hello,

I was wondering if there was any way to remove "~n" or new line(\n) from strings. I used replace, but it was useless. Can anyone help me?


Yasha(Posted 2015) [#2]
Care to elaborate on "useless"?


LT(Posted 2015) [#3]
Replace works, but you have to assign the result. My guess is that you're doing...

str.Replace( "~n", "" )

instead of...

str = str.Replace( "~n", "" )


Twinprogrammer(Posted 2015) [#4]
Oh yeah, that worked. I feel pretty stupid now :D
Thanks for the help guys!