/**
* 验证参数是否为数字,是true
* @param object
* @return
*/
public final static boolean isNumber(Object object) {
try {
Pattern p = Pattern.compile("-?[0-9]+(\\.[0-9]+)?");
Matcher m = p.matcher(object.toString());
return m.matches();
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
验证参数是否为数字,是true
最新推荐文章于 2023-04-02 21:44:25 发布