Created
May 2, 2018 16:27
-
-
Save khanlou/0c321e660f8eb7268da0759ec3bf308f 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
extension CharacterSet { | |
func contains(_ character: Character) -> Bool { | |
guard let firstScalar = character.unicodeScalars.first else { return false } | |
return self.contains(firstScalar) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment