利用正则表达式判断字符串是否是数字 @param str @return
(String str)
| 250 | * @return |
| 251 | */ |
| 252 | public static boolean isNumeric(String str) { |
| 253 | Pattern pattern = Pattern.compile("[0-9]*"); |
| 254 | Matcher isNum = pattern.matcher(str); |
| 255 | if (!isNum.matches()) { |
| 256 | return false; |
| 257 | } |
| 258 | return true; |
| 259 | } |
| 260 | |
| 261 | /** |
| 262 | * 获取错误提示 |