fromsymbol equivalent in JS?

elmiller's icon

Hi,
I am looking for a way to break a string into a string and an int within a JS file. For example, if I had the string "foo2" and wanted to break it into the string "foo" and the int 2.

Thanks,
Eric

MIB's icon

haven't tried it in max, but there is paresInt(string, radix). Google is your friend in situations like this. I simply googled: javascript string to int.

Luke Hall's icon

You would probably be best using regular expressions, there's lots of examples of out there for you to look through.

elmiller's icon

Alright, many thanks to both of you!