📅  最后修改于: 2022-03-11 15:04:02.351000             🧑  作者: Mango
var str = "my car is red";
var stringArray = str.split(/(\s+)/);
console.log(stringArray); // ["my", " ", "car", " ", "is", " ", "red"]