Its a bit unclear to what you want to check. I suggest you remove the -1
from the substring because it will break the emoji's code snip
void main() { var str = "abc😀"; var newStr = str.substring(0, str.length); // i removed it here print(newStr); print(newStr.runes); print(str.runes); }
This will give the output of
abc😀(97, 98, 99, 128512)(97, 98, 99, 128512)
Tested in https://dartpad.dartlang.org/