How to drop keys from string json in java?

后端 未结 2 1732
借酒劲吻你
借酒劲吻你 2021-01-26 06:44

I have a json string like this:

{\"a\":\"vala\", \"b\":\"valb\", \"c\":\"valc\"}

I want to convert the above string to a JSONObject so that I

2条回答
  •  失恋的感觉
    2021-01-26 06:57

    Firstly I think you need change title of question.

    Secondly, If you want change from String to Json just using org.json library

     JSONObject jsonObj = new JSONObject("{\"a\":\"valuea\",\"b\":\"valueb\"}");
    

    Are you tried remove. http://www.json.org/javadoc/org/json/JSONObject.html#remove(java.lang.String)

    Json.remove(key)

提交回复
热议问题