/**
* 判断是否为整数
*
* @param str 传入的字符串
* @return 是整数返回true,否则返回false
*/
public static boolean isInteger(String str) {
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
return pattern.matcher(str).matches();
}

相关文章:

  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-11-04
  • 2021-11-06
  • 2021-09-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
  • 2021-10-12
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
相关资源
相似解决方案