How can I strip Enter / Return from a string?

Find quick help here to get you started with Hollywood
Post Reply
amyren
Posts: 352
Joined: Thu May 02, 2019 11:53 am

How can I strip Enter / Return from a string?

Post by amyren »

When exporting a table to a csv file, I have this one text variable that originates from a rapagui Texteditor.
But if I had used Enter / Return inside the texteditor, it will make unwanted linefeeds in the csv file.
If I look at the file inside notepad++ or similar, there are no "\n" inside the line. I can see the LF symbol if I turn on to show symbols.

How can I process the string variable in order to remove the linefeeds, or better convert them to "\n"?

Likewise, my program have the option to import the csv file. How could I convert the "\n" back to linefeeds?

btw, I use #ENCODING_ISO8859_1 when I write to the csv file.
plouf
Posts: 462
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: How can I strip Enter / Return from a string?

Post by plouf »

isnt ReplaceStr(text$, "\r", "\n") works ?
Christos
amyren
Posts: 352
Joined: Thu May 02, 2019 11:53 am

Re: How can I strip Enter / Return from a string?

Post by amyren »

:oops: Yes it does.
I was thinking there was some other code for it, since writing \n in the texteditor did not cause a linefeed.
But thanks, now I can export and import without worrying about those LF's.
Post Reply