Problem · String

Remove Vowels from a String

Learn this problem
EasyHSBCOA

Problem statement

The vowels of the English alphabet are a, e, i, o, u, A, E, I, O, and U.

Given a string inputString, eliminate all vowels and return the resulting string.

Function

removeVowels(inputString: String) → String

Examples

Example 1

inputString = "haveaniceday"return = "hvncdy"

The output string is "hvncdy".

Constraints

  • 0 <= len <= 100, where len is the length of the input string.
  • The input string contains English letters only.

More HSBC problems

drafts saved locally
public String removeVowels(String inputString) {
  // Write your code here
}
inputString"haveaniceday"
expected"hvncdy"
checking account