JS: String.prototype.substr

By Xah Lee. Date: . Last updated: .
str.substr(index, length)
Return a substring of length length, starting at index
console.log( "abcd".substr(1,2) === "bc" ); // true
console.log( "abcd".substr(1, 9) === "bcd" ); // true
// length longer than available, take to the end instead

JavaScript, substring

BUY ΣJS JavaScript in Depth