摘要: 1. 全部替换 我们知道 string.replace() 函数仅替换第一次出现的情况。 你可以通过在正则表达式的末尾添加 /g 来替换所有出现的内容。 var example = "potato potato"; console.log(example.replace(/pot/, "tom")) 阅读全文
posted @ 2019-12-26 08:23 2807010508 阅读(205) 评论(0) 推荐(0) 编辑