188. Remove Vowels from String

EasyStringString

Given a string s, remove all vowels (a, e, i, o, u — both uppercase and lowercase) from it and return the resulting string.

All other characters (consonants, digits, spaces, punctuation) must be preserved in their original order.

Input: A single string s.

Output: The string with all vowels removed.

Examples

Example 1
Input: leetcodeisacommunityforcoders
Output: ltcdscmmntyfrcdrs
Explanation: All vowels (e,o,i,a,o,u,i,y... wait: y is not a vowel) removed.
Example 2
Input: aeiou
Output: 
Explanation: All characters are vowels → empty string.
Example 3
Input: rhythm
Output: rhythm
Explanation: No vowels in 'rhythm'.

Constraints

Asked by

Amazon
Solve this problem in the editor →