Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 648 Bytes

vowel_remover.md

File metadata and controls

27 lines (23 loc) · 648 Bytes

Description

Create a function called shortcut to remove the lowercase vowels (a, e, i, o, u) in a given string.

Examples

"hello" --> "hll"
"codewars" --> "cdwrs"
"goodbye" --> "gdby"
"HELLO" --> "HELLO"

  • don't worry about uppercase vowels
  • y is not considered a vowel for this kata

My Solution

def shortcut(s)
  s.delete('aeiou')
end

Better/Alternative solution from Codewars

def shortcut(s)
  s.gsub(/[aeiou]/, '')
end