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:
Best option is to use .getString()
method of JSONObject or .valueOf()
method of String.
You can also use the .replaceAll("\"","")
, but this has some problems, when the string itself contains "
(double quotes) embedded in it. So, avoid using the replaceAll() method to get out of the unexpected problems.
But still, if you want to code on own by your hand or If you want to know how to delete the double quotes without using getString() and .valueOf()
, you can try like this
testValue.toString().subString(1,testValue.toString().length())
it will give the sub string excluding first and last characters of the String. But, it seems like some messy thing.