Skip to content

Instantly share code, notes, and snippets.

@khanlou
Created May 2, 2018 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khanlou/0c321e660f8eb7268da0759ec3bf308f to your computer and use it in GitHub Desktop.
Save khanlou/0c321e660f8eb7268da0759ec3bf308f to your computer and use it in GitHub Desktop.
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