What's the easiest way to remove just the last character from a string?
Remove character from end of a string
BlitzMax Forums/BlitzMax Beginners Area/Remove character from end of a string lol, thanks guys, your speedy responses never cease to amaze ;0)
@EdzUp: Left() uses slicing anyways, the overhead call is probably going to loose a little speed :P
eww, it is also horrible to look at.
If you have a look at the code in BRL.Retro, you'll see that the Mid$() function Grey Alien is using uses slicing under the hood anyway, so you may as well cut out the middle man and just call it directly yourself.
you may as well cut out the middle man
Except that many folks are stuck in their old ways ;-)
A lot of people like Blitz because of the middlemen :)
lol, that is true, but going back to the original question...
Slicing is definitely easier than the Mid() function... Less characters to type for a start... ;-)
What's the easiest way to remove just the last character from a string?
Slicing is definitely easier than the Mid() function... Less characters to type for a start... ;-)
For me the Syntax of Mid is easier to understand than slicing. I have to think about slicing whereas Mid I do not, but that's from years of using Mid or the equivalent in Delphi.