Skip to content

Instantly share code, notes, and snippets.

View modestman's full-sized avatar

Anton Glezman modestman

View GitHub Profile
extension String {
var composedCount : Int {
var count = 0
enumerateSubstrings(in: startIndex..<endIndex, options: .byComposedCharacterSequences) {_ in count+=1}
return count
}
}