Created
January 7, 2016 00:41
-
-
Save mikekavouras/9d560b253989837c46eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func VowelRemover(str: String) -> String { | |
| let vowels: [Character] = ["a", "e", "i", "o", "u"] | |
| let chars = str.characters.filter { !vowels.contains($0) }.map { String($0) } | |
| return chars.joinWithSeparator("") | |
| // 1 liner | |
| // str.characters.filter { !["a", "e", "i", "o", "u"].contains($0) }.map { String($0) }.joinWithSeparator("") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment