fromsymbol equivalent in JS?

Apr 16, 2011 at 9:43pm

fromsymbol equivalent in JS?

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

#56379
Apr 17, 2011 at 8:07pm

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.

#202217
Apr 17, 2011 at 10:08pm

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

#202218
Apr 17, 2011 at 11:30pm

Alright, many thanks to both of you!

#202219

You must be logged in to reply to this topic.