How to convert jsonString to JSONObject in Java

前端 未结 19 3041
一生所求
一生所求 2020-11-22 00:39

I have String variable called jsonString:

{\"phonetype\":\"N95\",\"cat\":\"WP\"}

Now I want to convert it into JSON Object. I

19条回答
  •  梦毁少年i
    2020-11-22 01:27

    To anyone still looking for an answer:

    JSONParser parser = new JSONParser();
    JSONObject json = (JSONObject) parser.parse(stringToParse);
    

提交回复
热议问题