Solución
solution.tsTypeScript
public class Solution {
public int countConsonants(String text) {
int counter = 0;
text = text.toLowerCase();
for (int i = 0; i < text.length(); i++){
if(text.charAt(i) >= 'a' && text.charAt(i) <= 'z'){
if (text.charAt(i) != 'a' && text.charAt(i) != 'e' && text.charAt(i) != 'i' && text.charAt(i) != 'o' && text.charAt(i) != 'u' ){
counter++;
}
}
} return counter;
}
}0respuestas