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 Member, PRO Posts: 18

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

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271
    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 Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

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

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

    @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.