The JavaScript String substr() method returns a part of a given string, starting from the specified index and going up to the specified length.
See below example
var str = "Hello world!";
var res = str.substr(1, 4);
console.log(res);
The JavaScript String substr() method returns a part of a given string, starting from the specified index and going up to the specified length.
See below example
var str = "Hello world!";
var res = str.substr(1, 4);
console.log(res);
Leave a Reply