strSubstr method

String strSubstr(
  1. int start, [
  2. int? length
])

Implementation

String strSubstr(int start, [int? length]) {
  final int _length = length ?? length! - start;
  return substring(start, start + _length);

  // example:
  // strSubstr('Hello World', 0, 5); // returns 'Hello'
  // strSubstr('Hello World', 5); // returns 'World'
}