substring method Null safety

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

The substring of this string from start,inclusive, to end, exclusive.

Example:

var string = 'dartlang';
string.substring(1);    // 'artlang'
string.substring(1, 4); // 'art'

Implementation

String substring(int start, [int? end]);