Page 1 of 1

String manipulation/cleanup

Posted: Thu Dec 05, 2019 12:14 pm
by Nigg
Hey guys,

a long time since the last post here. I interrupt the pause!

Does anyone know a simple, efficient way to "clean up" a text string, like removing white-spaces or special characters, for example?

Re: String manipulation/cleanup

Posted: Thu Dec 05, 2019 4:09 pm
by dgilmour
StrChange can do the job:

Code: Select all

t$ = 'Lorem ipsum dolor sit amet'
f$ = ' '
r$ = ''
t$ = StrChange(t$, f$, r$)

Re: String manipulation/cleanup

Posted: Thu Dec 05, 2019 5:08 pm
by Nigg
Thanks, but that only works for one character, not for line breaks or more characters or a combination of that

// Edit: I was stupid, I now simply use multiple runs, works, thank you

Re: String manipulation/cleanup

Posted: Thu Dec 05, 2019 6:14 pm
by dgilmour
Nigg wrote:Thanks, but that only works for one character, not for line breaks or more characters or a combination of that
I almost believed you that it does work this way.