countGraphemes method
Implementation
int countGraphemes(String str) {
var count = 0;
var index = 0;
int brk;
while ((brk = nextBreak(str, index)) < str.length) {
index = brk;
count++;
}
if (index < str.length) {
count++;
}
return count;
}