- 1
Accept a string as parameter find out how many consonants present in it???
need to find consonant
1 Resposta
+ 2
are you talking about no of constant.
String vowel = "aeiou";
public int constantslen(String input){
string tmp = input;
for(int i=0; i<vowel.length();i++){
char ch = vowel.charAt(i);
tmp = tmp.replace(ch,'\0');
ch = Character.toUpperCase(ch);
tmp = tmp.replace(ch,'\0');
}
return tmp.length();
}