Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要在 JavaScript 中匹配/替换这些括号:
我需要喜欢:
element { property: value }
成为:
element property: value
谢谢。
您可以使用全局正则表达式使用 replace 方法去除这些括号:
var str="element { property: value }"; str=str.replace(/[\{\}]/g, "");