MCPcopy Index your code
hub / github.com/Bit0r/java-util / isNumeric

Method isNumeric

src/main/java/util/CommonUtils.java:252–259  ·  view source on GitHub ↗

利用正则表达式判断字符串是否是数字 @param str @return

(String str)

Source from the content-addressed store, hash-verified

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 * 获取错误提示

Callers

nothing calls this directly

Calls 1

matchesMethod · 0.80

Tested by

no test coverage detected