How do I remove the last value of a string variable

0 favourites
  • 3 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • I have objects that represent letters, when I click on one of them add a letter to a string, when I click on a "delete" object I want it to delete the last value added to the string, how do I delete it?

    is similar to a virtual keyboard, if you have another way to do it will be of great help

    tks

  • If you want to remove last character from the string, you can do this:

    Set s to left(s, len(s)-1)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • cyborgsattack.com/files/alphabet.zip

    I threw this together, you can expand on what to do with the array, but it is only currently going to store limited characters, I don't have it really set to a size that matters anyway, you can use it or not.

    The point in this project is creating your characters, adding them to a family, giving the user the ability to click on them, add them to your scene, click red X to delete last created character, which I think matches your request on how you do it.

    I am assuming a lot here, such as you have your image files already, you know your character list, your simply trying to create them on a click of existing like a virtual keyboard, then finally the trick of removing the last created character no matter which it was (aka family member)

    If I'm off base, let me know

    Created in R106 of C3

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)