GameSalad

How can I display only parts of a text attribute?

Hello,

So I have a text attribute that would have say a name, and a number following it. For example "JohnSmith24"

Is there a way I can separate and display the "JohnSmith" and "24" parts in separate actors WITHOUT putting these in separate variables?

Comments

  • TheAJTurnerTheAJTurner Posts: 18Member, PRO

    Actually I believe I figured this one out with the textSubString function

  • Braydon_SFXBraydon_SFX Dallas, TexasPosts: 8,882Member, Sous Chef, PRO, Bowlboy Sidekick
    edited March 2016

    In separate actors without separate variables. Maybe. Does the character count of numbers (in your example it would be two numbers in that name: 2 and 4) always remain the same for each name? If so, you can use the character count function to find the overall character count of the name. Once this is done you'd know how many characters the name consists of because there would always be two numbers attached to the end of the name. You can then use the substring function to display a certain amount of characters in each actor.

    Make sense?

    Let me see if I can make a demo for you... back in a moment.

  • Braydon_SFXBraydon_SFX Dallas, TexasPosts: 8,882Member, Sous Chef, PRO, Bowlboy Sidekick

    Try this. Uses the textSubString function and the textLength function.

  • Braydon_SFXBraydon_SFX Dallas, TexasPosts: 8,882Member, Sous Chef, PRO, Bowlboy Sidekick

    @TheAJTurner said:
    Actually I believe I figured this one out with the textSubString function

    Oops. Only saw this now. Anyway, hope the demo sheds some additional light. :)

Sign In or Register to comment.