/*** 查询字符串中首个数字出现的位置* @param str 查询的字符串* @return 若存在,返回位置索引,否则返回-1;*/public static int findFirstIndexNumberOfStr(String str){int i = -1;Matcher matcher = Pattern.compile("[0-9]").matcher(str);if(matcher.find()) {i = matcher.start();}return i;}
/*** 查询字符串中首个数字出现的位置* @param str 查询的字符串* @return 若存在,返回位置索引,否则返回-1;*/public static int findFirstIndexNumberOfStr(String str){int i = -1;Matcher matcher = Pattern.compile("[0-9]").matcher(str);if(matcher.find()) {i = matcher.start();}return i;}