For the json string like below, I'd like to iterate over the DayOrder 2 and 3, how can I parse?
{
"data": [
{
"DayOrder": 2,
"DayOfWeekStr": "Tuesday"
},
{
"DayOrder": 3,
"DayOfWeekStr": "Wednesday"
}
]
}
The code I've tried is like:
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
JSONParser jsonParser = new JSONParser();
Object obj = jsonParser.parse(inputstring);
JSONArray array = (JSONArray) obj["data"];
And I've tried a lot others but not work