Created
October 29, 2017 13:54
-
-
Save darcwader/3d7168d51fc225e9b5a85d45c68fd4b0 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 tokenize(_ message:String) -> [String] { | |
| let trimmed = message.lowercased().trimmingCharacters(in: CharacterSet(charactersIn: "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~")) | |
| let tokens = trimmed.components(separatedBy: CharacterSet.whitespaces) | |
| return tokens | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment