Re: beginner: how to remove dot's and empty spaces from a number
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: beginner: how to remove dot's and empty spaces from a number

From: <alexey@shtokalo.net>
Date: Mon Jan 23 2006 - 13:58:47 CET

You can do this with using regular expression:

var strNumber = '12.34.56.789';
strNumber = strNumber.replace(/[^\d]/, '');

By the way...

function isNumber(_strValue)
{
    return strNumber.match(/^\d+$/) != null;
}
Received on Tue Feb 7 21:19:02 2006