Last active
November 25, 2016 11:30
-
-
Save westerlund/4b5e95d5d8bd57cbeadd431774171667 to your computer and use it in GitHub Desktop.
This file contains 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
extension String { | |
func pirated() -> String { | |
let consonants = "bcdfghjklmnpqrstvwxyz" | |
return characters.map({ char -> String in | |
let character = String(char) | |
if consonants.contains(character.lowercased()) { | |
return "\(char)o\(character.lowercased())" | |
} | |
return character | |
}).joined() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hej världen
printsHohejoj vovärorloldodenon
, enjoy!