- Declare a string variable for the return value, and initialize it to "".
- Use a for loop to iterate over all the characters in the supplied string.
- Use a conditional or switch statement to check whether the character is a vowel.
- The vowels are 'a','e','i','o', and 'u', uppercase or lowercase.
- If it is a vowel, do nothing, otherwise add the character to the return string.
- After the loop has completed, return the string.
This is what I have so far, I'm new to this so any help would be appreciated.
public static String removeVowels(String input) {
String s = "";
int f = 0;
for(int i = 0; i < input.length(); i++){
if(c == 'a'|c == 'e'|c == 'i'|c == 'o'|c =='u' | c == 'A' | c == 'E' | c == 'I' | c == 'O' | c == 'U')
f = 1;
else{
s = s + i;
f = 0;
}
}
return s;
}