日期:2014-05-20 浏览次数:20681 次
public class TestString {
public static void main(String[] args) {
String s = "adfhsdji@$%jjog38e7eurqu83749866*&&*((T";
String[] strs = s.split("");
int count = 0;
for (int i=0; i<strs.length; i++ ) {
if (!"0123456789".contains(strs[i])) continue;
count++;
System.out.println(strs[i]);
}
System.out.print("一共有" + count + "个数字。");
}
}