if(inputStr.indexOf("\\d+")<0)
这样子返回的怎么都是-1啊???
求解~
------解决方案--------------------
用正则吧:
public static boolean isHasDigital(String checkStr) {
Pattern pattern = Pattern.compile("\\d+");
Matcher matcher = pattern.matcher(checkStr);
boolean match = matcher.find();
if (match) {
return true;
}
return false;
}