The substring() extracts characters from indexStart up to but not including indexStart in particular. If an indexEnd is omitted, then the substring() extracts characters to the end of a  string. If an indexStart is equal to the indexEnd, then the substring() returns an empty  string.

Javascript String substring()

Javascript string substring() is an inbuilt function that returns a part of the string between the start and end indexes, or to the end of a string.

Syntax

The syntax for the javascript string substring() method is the following.

string.substring(indexStart,indexEnd)

#javascript #javascript string substring #js

Javascript String SubString: How to Get SubString in JS
6.20 GEEK