My JSON object has a pages array and elements array inside it. elements array has many objects .each objects has correct answer attribute
I want to remove the correct answer attribute from the whole JSON.
I tried in this way but I couldn't remove the correct answer attribute.
var o = (Newtonsoft.Json.Linq.JObject)JsonConvert.DeserializeObject(ob.Json);
o.Property("pages").Remove();
{
"pages": [
{
"name": "page1",
"elements": [
{
"type": "radiogroup",
"name": "question1",
"correctAnswer": "item1",
"choices": [
"item1",
"item2",
"item3"
]
},
{
"type": "radiogroup",
"name": "question2",
"correctAnswer": "item2",
"choices": [
"item1",
"item2",
"item3"
]
},
]
}
]
}