substring method

String substring (
  1. int startIndex,
  2. [int endIndex]
)

Returns the substring of this string that extends from startIndex, inclusive, to endIndex, exclusive.

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

Implementation

String substring(int startIndex, [int endIndex]);