如何将所有双引号替换为开括号和闭括号。
但是最终我得到了这个结果:
感谢您的提前帮助。
let str = "This" is my "new" key "string";
我尝试使用以下正则表达式
str.replace(/"/,'{').replace(/"/,'}')
但是最终我得到了这个结果:
{This} is my "new" key "string"
这里我只得到了第一个单词被更改,但我想要更改所有的单词。 我希望结果是:
{This} is my {new} key {string}
感谢您的提前帮助。