/// Returns the text with all vowels removed.
String removeVowels(String text) {
    String result = "";
    for (int i = 0; i < text.length(); i++) {
        char letter = text.charAt(i);
        if ("aeiouAEIOU".indexOf(letter) == -1) {
            result += letter;
        }
    }
    return result;
}

void main() {
    IO.println(removeVowels("Programming in Java"));
}

// From Groundwork, chapter 8 (ch08-strings-as-data), box 14.
// This example is from Groundwork, licensed CC BY-NC-SA 4.0.
// Run with: java ch08_14.java
