Modifying Strings

BlitzMax Forums/BlitzMax Beginners Area/Modifying Strings

KrayzBlu(Posted 2005) [#1]
Hi, I've been playing with strings the last little while, and I've noticed that you can add a character onto a string simply by doing
text = text + "d"


Is there any way to take the last character off? I can't seem to find any easy way...

Thanks,
KrayzBlu


tonyg(Posted 2005) [#2]
text = Left(text,Len(text)-1)
or
text = text[..Len(text)-1]


KrayzBlu(Posted 2005) [#3]
:D
Thanks!
So easy and yet took so long to find ;)


Beaker(Posted 2005) [#4]
Alternatives:

text :+ "d"

text = text[..text.length-1]