string json = "{"httpStatusCode": "OK",
"count": 10,
"entities": [
{
"responseCode": 200,
"ResponseCode": 0,
"headers": null,
"Headers": null,
"content": "name1"
},
{
"responseCode": 200,
"ResponseCode": 0,
"headers": null,
"Headers": null,
"content": "name2"
}
]
}"
I use this piece of code and can not print out the value of "content" (name1, name2), it will just skip the if statement
JObject o = JObject.Parse(json);
foreach (var element in o["entities"])
{
foreach(var ob in element)
{
if(ob.toString() == "content")
Console.WriteLine(ob);
}
}
So, how can I print out the name1 and name2? Thank you.