Code is written in java
JSONArray resultArray = (JSONArray)resultObject;
String str = (resultArray.get(0).toString())
Now I have a string which is as follows
{
"styleId": "2276730",
"price": "$199.95",
"originalPrice": "$199.95",
"colorId": "401",
"productName": "Mutiny",
"productId": "8149427",
"percentOff": "0%"
},
I want to have the value of price for each such array
I am a newbie to JSON. Can anyone help me with this?
getthe element by number, cast the result to JSONObject, and then doget("price")on that. This should directly return a String containing the price.