//only works for a string beginning with a number!
('123 Hello World').toInt(); //=> '123'
Mootools FTW!
Seperate a number (int) from string using Mootools
Reply
I recently blogged about using regular expressions to extract a number or integer from a string in javascript. So what if you are using Mootools? Well you save even more time: