/**

* 给定一个字符串,统计每个字符出现的次数。 如:abdaewrwqask435a1aasd
*/
public class ReplaceString {
static int length;

public static void countString(String s) {
while (s.length() > 0) {
String oldStr = String.valueOf(s.charAt(0));
String newStr = s.replace(oldStr, "");
length = s.length() - newStr.length();
s = newStr;
System.out.println(oldStr + ":" + length);
}
}

public static void main(String[] args) {
String s = "abdaewrwqask435a1aasd";
countString(s);

}
}

05-01 06:42