String.substring

String substring (Number indexA, Number indexB)

Parameters

indexA The index to begin extracting.
indexB (Optional) The index at which to end extraction.

Description

Returns a substring of the given string by extracting characters from indexA up to but not including indexB.

The original string is unchanged. Returns a substring of characters from the given string, starting at indexA and ending with indexB-1.