Seperate a number (int) from string using Mootools
Posted in Javascript | No Comments
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:
//only works for a string beginning with a number!
('123 Hello World').toInt(); //=> '123'
Mootools FTW!
Tags: mootools
You might also like:
- Google Analyitics - fix the '_gat' is undefined problem in IE6 with Mootools
- Detect Internet Explorer 6 (IE6) and other popular browsers with Mootools
- Javascript: Passing variables with setTimeout and getting it to work in Internet Explorer
- Checklist for a Successful Website Launch
- Detect ALL versions of internet explorer 6 with one line of javascript!
- Seperate a number (int) from a string in Javascript