Which of the following function is used extract a sub string between the specified range: code example
Example: javascript substring vs substr
var string = "This is a string";
var a = string.substring(2, 5); //Start at index 2 and end at index 5
console.log(a); //output "is "
var b = string.substr(2, 5); //Start at index 2 and stop after 5 characters
console.log(b); //output "is is"