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