📜  将字符串 javascript 从索引切片到空间 - Javascript 代码示例

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

代码示例1
const data ="Hello my name is Hastings"
data = data.slice(0, data.indexOf(" ")); 
console.log(data)
//Output = "Hello"