1 private boolean isInteger(final String str) 2 { 3 final Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); 4 return pattern.matcher(str).matches(); 5 }
时间: 2024-11-07 21:46:13
1 private boolean isInteger(final String str) 2 { 3 final Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); 4 return pattern.matcher(str).matches(); 5 }