/** * 验证参数是否为数字,是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
猜你喜欢
转载自blog.csdn.net/qq_38567039/article/details/80521184
今日推荐
周排行