如何使用replace()
从字符串中删除逗号。
"{"segerity": 5,"designJroups": "AB3,EncKrodPvc", "segerity": 2}"
"{"segerity": 5,"designJroups": None, "segerity": 2}"
我正在尝试类似的事情
const objRemove = ReplaceData.replace(/deviceGroups[^,]+"/g, '');
由于我有+
,因此replace()
方法将一直删除,直到"designJroups": "AB3,
我需要删除整个"designJroups": "AB3,EncKrodPvc",
预期结果
"{"segerity": 5,"segerity": 2}"
"{"segerity": 5,"segerity": 2}"