I'm trying to parse a JSON object and construct a String using the data. An example object I'm using looks like this:
{
"age": 35,
"name": "",
"time": {
"24hr": true,
"12hr": false
}
}
I'd like the output to look like this:
age - 35
name
time - 24hr:true, 12hr:false
I'm running into a problem since the keys have different value types. "age" has an integer, "name" has an empty string, and "time" has an object.
What's the easiest way to construct that output?
Currently, I have a for loop that can print out the keys, but the values don't appear correctly.
Thanks