Write a recursive method that will remove all the vowels from a given string and return what is left as a new string. Hint: Use the + operator to perform string concatenation to construct the string that is returned.
What will be an ideal response?
```
public static String removeVowels(String s){
String result;
if(s.length() == 0)
result = "";
else {
if(isVowel(s.charAt(0)))
result = removeVowels(s.substring(1));
else
result = s.charAt(0) + removeVowels(s.substring(1));
}
return result;
}
```
This code is in Methods.java.
You might also like to view...
One of the fastest ways to switch from editing one method to editing another is to right-click an invocation of that method in the ____ and then choose its name from the ____ that appears.
A. object tree; object selector B. editing area; context menu C. structure diagram; context menu D. details area; object selector
True or false: You do not need to attach a Canvas Component when working with the new UGUI system
Indicate whether the statement is true or false
What wireless methods exist for connecting to a printer?
A. Bluetooth B. ZigBee C. Wi-Fi infrastructure mode D. Wi-Fi ad-hoc mode
WEP's RC4 approach to encryption uses a 24-bit string of characters added to transmitted data, such that the same plain-text data frame will never appear as the same WEP-encrypted data frame. What is this string of characters called?
a. Initialization vector b. Chips c. Orthogonal descriptor d. Session key