计算字符串中字符个数
public int getSubNumber(String des, String reg) {
Pattern p = Pattern.compile(reg);
Matcher m = p.matcher(des);
int count = 0;//记录个数
while(m.find()){
count++;
}
return count;
}
public int getSubNumber(String des, String reg) {
Pattern p = Pattern.compile(reg);
Matcher m = p.matcher(des);
int count = 0;//记录个数
while(m.find()){
count++;
}
return count;
}