Implement the method removeVowels that takes a string as input and returns the string after removing all vowels from it.

Learner Level
String Manipulation Loop

The function should remove both lowercase and uppercase vowels:

  • Vowels to remove: a, e, i, o, u, A, E, I, O, U

Only vowel characters should be removed — all other characters should remain unchanged and in the same order.

Example 1
Input:
s (string) = hello
Return:
(string) hll
Example 2
Input:
s (string) = Programming
Return:
(string) Prgrmmng
Example 3
Input:
s (string) = W3Schools
Return:
(string) W3Schls
Example 4
Input:
s (string) = sky
Return:
(string) sky

To remove vowels from a string:

  1. Define a set of vowels (both uppercase and lowercase).
  2. Iterate through each character in the input string.
  3. If the character is not a vowel, include it in the result.
  4. Return the result string after the loop.

Pseudocode:

Function removeVowels(s):
    Define vowels as set of a, e, i, o, u, A, E, I, O, U
    Initialize empty result string
    For each character ch in s:
        If ch is not in vowels:
            Append ch to result
    Return result
Run your code to see the result.