Stripping Strings of Letters

Is there a way to take all the letters out of a string and then use it as a integer?

If that is not possible, is there a way to take the first three letters off a string variable?

i.e. make [COLOR=crimson]myVariable=‘pic1’[/COLOR] into [COLOR=crimson]myVariable = ‘1’[/COLOR]

Yes? no?

myVariable = number(myVariable.charAt(3))

would do it :slight_smile:

also see:
http://proto.layer51.com/d.aspx?f=546
:wink:

nice protos you got there sen :slight_smile:

Thanks guys, I used ahmed’s idea though, after some reading (i probably should have read the AS reference first), i found that what i really needed was the substring method, because some of my variable values were more that 4 digits, and the charAt only got the third character.

But Thanks, to both of you!