I'm trying to write a recursive method that removes vowels from a string. If someone can help me formulate a pseudocode to do this, that would be great.
So far my code is:
Expand|Select|Wrap|Line Numbers
- public static void RemoveVowels(String str)
- if str.substring(0,1).compareToIgnoreCase("a" == 0)
- {
- str.replace("a", "");
- RemoveVowels(s.substring(1));
- }
- else
- RemoveVowels(s.substring(1));
I'm also having trouble of coming up with a way to return this new string. Should I use a return statement?
Thanks!