-1

我有这个字符串

var newtypegraph=newtypegraph.replace(' "type":"bar3d" ',' "type":"area" ');

我想将 bar3d 设为通配符。

4

1 回答 1

1

这看起来像 JavaScript,所以你可以使用正则表达式:

var newtypegraph = newtypegraph.replace(/"type":".*?"/g, '"type":"area"');

这看起来像 JSON 对象的属性。这是 JSON 吗?

于 2013-04-15T03:20:31.410 回答