Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JSON文字列を適切なJava文字列に変換して、次のようなすべての引用文字をエスケープする方法はありますか{\"hello\":\"world\"}
{\"hello\":\"world\"}
私はアンドロイドのjsonライブラリをベースにしていorg.jsonます。
json
org.json
ありがとう
Bigflowはすでにコメントで回答していますが、一部を追加してすべてをエスケープするだけです"
"
String obj = JSONObject.getString().replace("\"", "\\\"");