slice method

String slice(
  1. int start, [
  2. int? end
])

Implementation

String slice(int start, [int? end]) {
  if (end != null && end.isNegative) {
    return substring(start, length - end.abs());
  }
  return substring(start, end);
}