JavaScript String substr

JavaScript String substr


JavaScript String substr() method
In this Tutorial, we will learn about JavaScript String substr() method with the help of following below:
substr()
This method returns a subset of a string object.
Syntax
String.substring(indexA, [indexB])
Parameters:
indexA: An integer between 0 and one less than the length of the string.
indexB: (optional) An integer between 0 and the length of the string.
ReturnValue: 
The string method returns the new sub string based on given parameters.
Example
Output