Valery Domozhirov Valery Domozhirov - 3 months ago 9
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

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

var flag = "
Comments