原始字符串为”Hallo World!” ,目标字符为”W”,计算该字符重复次数
String temp= "Hallo World!";
String target= "W";
int count = temp.length() - temp.replace(target, "").length();
原始字符串为”Hallo World!” ,目标字符为”W”,计算该字符重复次数
String temp= "Hallo World!";
String target= "W";
int count = temp.length() - temp.replace(target, "").length();