📜  Javascript 中使用切片的子字符串 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:46.340000             🧑  作者: Mango

代码示例1
let str = "Learning to code";

// slice between index 0 and index 5
console.log(str.slice(0, 5));
// slice between index 5 and index 10
console.log(str.slice(5, 10));