1.判断字符串是否以数字开头
public boolean startWithNumber(String str){
return Pattern.matches("[0-9].*", str);
}
本文介绍了一种简单的方法来判断一个字符串是否以数字开头。通过使用正则表达式,我们可以轻松实现这一功能。
1.判断字符串是否以数字开头
public boolean startWithNumber(String str){
return Pattern.matches("[0-9].*", str);
}
1324
2万+

被折叠的 条评论
为什么被折叠?