Skip to content

Instantly share code, notes, and snippets.

@tularovbeslan
Created December 4, 2016 21:50
Show Gist options
  • Select an option

  • Save tularovbeslan/980474b414a50890ec0209992b939eee to your computer and use it in GitHub Desktop.

Select an option

Save tularovbeslan/980474b414a50890ec0209992b939eee to your computer and use it in GitHub Desktop.
checks for Cyrillic
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