How to convert jsonString to JSONObject in Java

前端 未结 19 3039
一生所求
一生所求 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条回答
  •  别那么骄傲
    2020-11-22 01:32

    To convert String into JSONObject you just need to pass the String instance into Constructor of JSONObject.

    Eg:

    JSONObject jsonObj = new JSONObject("your string");
    

提交回复
热议问题