Shortening my string
Blitz3D Forums/Blitz3D Beginners Area/Shortening my string
| ||
So there I was, playing around with Blitz3D once again, making fun little pieces of code to keep boredom at bay. However, I realized that I didn't know how to do what I wanted to do. Alas, I turned to the masters for help! Here's my problem. I have created a string: "Hello world" I want to be able to erase the last letter of the string when I press backspace. Backspace press= "Hello worl" Another backspace press= "Hello wor" But I don't know how to do that^^ Please help, O great ones! |
| ||
str = Left(str, Len(str) - 1) ? |
| ||
You are very much capable of figuring this out; it's a matter of logic. A backspace removes a character from the end of the string. How do you retrieve a string that is the current string without the last character? value$ = "Hello World" Mid(value, 1, Len(value)-1) |
| ||
Ah, thank you. See, I've hardly ever worked with strings, so the commands are a little foreign to me. I do apologize if this question was a little too stupid for the forums. o_o I will strive to be less incompetent in the future! |
| ||
Many times you just can't think outside the box or see the solution which is partially there, but out of your reach. So a second opinion is necessary. With that in mind, there is no such thing as a stupid question :) |