📜  js中的切片方法 - Javascript代码示例

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

代码示例6
let ourString = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.";
ourString.slice(0, 11);
console.log(ourString.slice(0, 11));
//Lorem ipsum

string.slice(start, end);
//Start is required. The position where to begin the extraction. 
//First character is at position 0

//End is optional. 
//The position (up to, but not including) where to end the extraction.