Trim commands not working?

Just starting out? Need help? Post your questions and find answers here.
CharlesT
User
User
Posts: 19
Joined: Sun Jan 07, 2018 10:09 pm

Trim commands not working?

Post 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.
User avatar
StarBootics
Addict
Addict
Posts: 984
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: Trim commands not working?

Post by StarBootics »

Hello,

Try this code :

Code: Select all

Text.s = "Hello!"
Text = RTrim(Text, "!")
Debug Text
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
CharlesT
User
User
Posts: 19
Joined: Sun Jan 07, 2018 10:09 pm

Re: Trim commands not working?

Post by CharlesT »

*Facepalm*

StarBootics, thank you!
Post Reply