Get seperate character/number count in text string [A-Z][0-9]

Hi all

I am trying to get a findtext to return a character count between [A-Z] and another for [0-9).

The task I am working on is to place an actor as a cursor on a text input field as part of a high score table.

Because the width of A-Z and 0-9 are different, I need to calculate the cursor position.x on a calculation on how many alphabetical and numberic values are contained in the text.

I know you can append lua to the end of a statement like :upper() but I cant seem to get a letter count of a string returned.

Any advanced GS people out there who would be able to help?

Looking for something like: change attribute self.lettercount = textfile(self.name,"%d",1) BUT need to place %d with something that returns the occurance count greater than 1 and not just 1.

If player is called "PLAYER 123" then I need self.lettercount = 6 and self.numbercount = 3

Comments

Sign In or Register to comment.