Remove quote from the JSONArray output

后端 未结 13 1942
野性不改
野性不改 2021-01-02 02:45

On the successful call, I am getting the JSONArray with the key \"objects\" and again the testValue with the key \"name\". The output is Like:



        
13条回答
  •  梦谈多话
    2021-01-02 03:28

    You can get the value as a String itself, don't need to cast or replace:

    JSONObject childJSONObject = (JSONObject) test.get(i);
    String testValue = childJSONObject.getString("name");
    

    It will return a String without quotes.

    More info: JSONObject

提交回复
热议问题