String str1 = "adasfAAADFD 123&*";
int letter = 0;
int number = 0;
int space = 0;
int other=0;
for (int i = 0; i < str1.length(); i++) {
if (Character.isDigit(str1.charAt(i))) {
letter++;
}else if(Character.isLetter(str1.charAt(i))){
number++;
}else if (Character.isSpace(str1.charAt(i))) {
space++;
}
else{
other++;
}
}
|