Last Updated: 30 Mar, 2026

Extract Vowels

Easy
Asked in company
HCL Technologies

Problem statement

You are given a string S which may contain a mix of uppercase letters, lowercase letters, and other characters. Your task is to find all the vowel characters within this string and return them as a new string.


Rules:

  • The vowels are 'a', 'e', 'i', 'o', 'u'.
  • The search must be case-insensitive, meaning both 'a' and 'A' are considered vowels and should be included in the result.
  • The vowels in the output string must appear in the same order as they did in the original string.
  • If no vowels are present in the input string, your function should return an empty string.

    Input Format:
    The first and only line of input contains a single string S.
    


    Output Format:
    Your function should return a single string containing only the extracted vowels. The runner code will handle printing this returned value.