Valery Domozhirov Valery Domozhirov - 1 year ago 95
Swift Question

How to remove a flag from the end of a string?

I found a strange behavior for function String.characters.count for rows in which row are the Emoji flags:

import UIKit

var flag = "

Answer Source

There is no bug. A sequence of "Regional Indicator" characters is a single "extended grapheme cluster", that is why

var flag = "
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download