Created
December 4, 2016 21:50
-
-
Save tularovbeslan/980474b414a50890ec0209992b939eee to your computer and use it in GitHub Desktop.
checks for Cyrillic
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 String { | |
| var isCyrillic: Bool { | |
| let chars: Set = ["А","Б","В","Г","Д","Е","Ж","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ч","Ш","Щ","Ь","Ю","Я","а","б","в","г","д","е","ж","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ч","ш","щ","ь","ю","я"] | |
| for c in self.characters { | |
| if chars.contains(String(c)) { | |
| return true | |
| } | |
| } | |
| return false | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment