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

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

代码示例1
const string = "hello world 123";

// remove all o's from the string
string.replace(/o/g, "") // "hell wrld 123"

// remove all letters from the string
string.replace(/[A-Za-z]/g, "") // "  123"

// remove all digits from the string
string.replace(/\d/g, "") // "hello world "