Summary
The substring() and substr() methods are used to return a part of a string from the start index up to and excluding the end index, or to the end of the string if no end index is supplied. The substring() method returns the part of the string from the start index up to and excluding the end index, while the substr() method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards.
1
2
According to