java中关于json字符串的处理求助:
如下数据:
{"name":"王大锤","age":"28","city":"杭州市","relation":"{"a":"peter","b":"tom","c":"jack"}","lover":"jenny"}
这样的数据json对象中存放了对象,在json字符串转换json对象时,就会格式报错。我的解决就是把它单独拿出来处理,原来的字符串中替换为空字符串,如下:
{"name":"王大锤","age":"28","city":"杭州市","relation":"","lover":"jenny"}
现在的问题是如何在其中把 {"a":"peter","b":"tom","c":"jack"} 替换为 "".
求助大神们,。。。
chaosbead
相关分类