📌  相关文章
📜  从字符串中删除单词 javascript 代码示例

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

代码示例4
string2 = "I love you 我爱你"
englishChars = string2.replace(/[^a-z ]/ig, "").trim().split(/\s+/);
nonEnglishChars = string2.replace(/[a-z ]/ig, "").split(/[ ]*/);
final = englishChars.concat(nonEnglishChars);
console.log(final);