In Swift 3, it is CharacterSetre-designed to work well with UnicodeScalar, and not with, the UTF-8 code point.
In this case, you can write something like the following:
var containsAlphabets: Bool {
return self.unicodeScalars.contains {CharacterSet.letters.contains($0)}
}
Give it a try.
Ooper source
share