Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » A quick way to remove the last character off a string?
- ge-b
-
100+ posts
A quick way to remove the last character off a string?
May have been answered, but I couldn't find it.
I'm trying to make a backspace key in a typing program and I'm currently doing:
Thanks.
I'm trying to make a backspace key in a typing program and I'm currently doing:
and it's not very effective when the string gets long.
Thanks.
Last edited by ge-b (Oct. 28, 2018 08:04:45)
- ShinigamiBlacky
-
100+ posts
A quick way to remove the last character off a string?
you can save 2 varaibles with this :D
also you can cut the huge string (while writing) into lots of small strings and save then in a list to edit the last item
also you can cut the huge string (while writing) into lots of small strings and save then in a list to edit the last item
Last edited by ShinigamiBlacky (Oct. 28, 2018 15:21:03)
- deck26
-
1000+ posts
A quick way to remove the last character off a string?
An alternative is to put each new character in a list. You can set a variable to a list and if it only contains single characters you'll get a string just containing those characters. That gives you easier options for deleting characters.
- the_wild_coder
-
100+ posts
A quick way to remove the last character off a string?
:Di have tried this in my projects and it does not work properly. you can save 2 varaibles with this
also you can cut the huge string (while writing) into lots of small strings and save then in a list to edit the last item
it turns the command “print (argument)” into “ppp”
- PSstarindia776
-
500+ posts
A quick way to remove the last character off a string?
Try this:
Create a list named stl (string-to-list)
Now use the
Create a list named stl (string-to-list)
Now use the
variable to get the removed letter from the text!
- Discussion Forums
- » Help with Scripts
-
» A quick way to remove the last character off a string?