public static Boolean isStartWithNumber(String str) {
Boolean flag = null;
try {
flag = true;
Pattern pattern = Pattern.compile("[0-9]*");
Matcher isNum = pattern.matcher(str.charAt(str.length()-1)+"");
if (!isNum.matches()) {
return false;
}
} catch (Exception e) {
e.printStackTrace();
return false;
}
return flag;
}
java判断字符串是否以数字结尾
最新推荐文章于 2023-10-31 14:38:57 发布