diff --git a/src/js/string.js b/src/js/string.js index 7b35d8d69de67aeed101dd798d348ad076193ddc..be8a715d167572a4b611b8174e47f91c428d715b 100644 --- a/src/js/string.js +++ b/src/js/string.js @@ -35,3 +35,22 @@ String.prototype.format = function(args) } return result; }; + + +/** + * Judge the string is a integer number + * + * @access public + * @return bool + */ +String.prototype.isNum = function(s) +{ + if(s!=null) + { + var r, re; + re = /\d*/i; + r = s.match(re); + return (r == s) ? true : false; + } + return false; +}