我有一个带有&Quot;的json字符串。代替双引号,并且json文本内也有引号。如何替换这些&Quot;用双引号仅与键和值相关联,而不与值(即json文本)相关联。
这是输入:
"description": "First: "Thank you" always receive a very thorough examination and feel confident with my care"
and OutPut should be :
"description": "First: "Thank you" always receive a very thorough examination and feel confident with my care"
如果替换所有&Quot;它不会生成有效的json
引号即&Quot;谢谢,应该留在身边。
我从html页面的脚本标签中获得了这个json字符串,并且我将Java与Xpath一起使用来从脚本标签中获取内容,并且它带有编码为&Quot的双引号。这就是我获取字符串的方式< / p>
{"@type": "Review",
"reviewRating": {
"@type": "Rating",
"ratingValue": "5",
"bestRating": "5",
"worstRating": "1"
},
"description": "First: "Thank you" always receive a very thorough examination and feel confident with my care",
"author": {
"@type": "Person",
"name": "Anonymous"
}
}
I just want to replace the &Quot value inside the text with any value apart from double quotes ,I don't have control over the source html here