Page 1 of 1

Trim commands not working?

Posted: Mon Jul 16, 2018 12:46 am
by CharlesT
Hi all. I am trying to use the RTrim command to remove a character from the end of a string.

Code: Select all

Text.s = "Hello!"
RTrim(Text, "!")
Debug Text
For me, this outputs "Hello!" -- nothing trimmed off. Trim and LTrim also seem not to be working for me. Am I doing something wrong? Using PureBasic 5.61 (licensed).

Thanks in advance.

Re: Trim commands not working?

Posted: Mon Jul 16, 2018 12:59 am
by StarBootics
Hello,

Try this code :

Code: Select all

Text.s = "Hello!"
Text = RTrim(Text, "!")
Debug Text
Best regards
StarBootics

Re: Trim commands not working?

Posted: Mon Jul 16, 2018 1:18 am
by CharlesT
*Facepalm*

StarBootics, thank you!