JavaScript String substring()
JavaScript String substring()
The substring() method is used to extract characters between two indices from a string and return the substring. It extracts characters from start to end. It does not affect the original string.
Syntax:-
Its syntax is:- string.substring(start, end)
Return:-
Its return is:- string containing the extracted characters.
Further Explanation:-
Parameter | Description |
start | Required. Start position. |
end | Optional. The end position. |