public boolean isNumber(String str){ Pattern pattern=Pattern.compile("^(([1-9]{1}\d*)|([0]{1}))(\.(\d){0,2})?$"); // 判断小数点后2位的数字的正则表达式 Matcher match=pattern.matcher(str); if(match.matches()==false){ return false; }else{
在此对原文作者表示感谢