我创建一个json,然后尝试从json中删除后退图标“ \”。
{"Brand":"Assemble Computer","Issue with device":"Power Code\/VGA","Problem in":"{\"0\":\"HDD\",\"1\":\"SSD\",\"2\":\"DVD writer\",\"3\":\"Keyboard Mouse\",\"4\":\"Monitor\"}","Model":"dddff"}
在此json中,我尝试删除问题键中的“ \”,我该怎么做?
答案 0 :(得分:0)
使用正则表达式并替换吗?
final String regex = "\\\\\\\"";
String originalJson = ... (your json);
String newJson = originalJson.replaceAll(regex, "\"");
这将用常规的替换所有逃逸的定量...