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:
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