substring function
Implementation
String substring(String str, int start, [int? end]) {
end ??= start + 1;
final splitter = GraphemeSplitter();
final iterator = splitter.iterateGraphemes(str.substring(start));
final strBuffer = StringBuffer();
for (var i = 0; i < end - start; i++) {
strBuffer.write(iterator.elementAt(i));
}
return strBuffer.toString();
}