Valery Domozhirov Valery Domozhirov - 9 months ago 38
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 = "


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

var flag = "