📅  最后修改于: 2022-03-11 15:02:28.341000             🧑  作者: Mango
const str = "Learning to code";
// start index is 1, length is 4
console.log(str.substr(1, 10));
// start index is 3, length is 2
console.log(str.substr(3, 2));
// length not given
// string extract to end of the string
console.log(str.substr(5));