I've got a JSON object that's returned from an API and some of the nodes are arrays. Is there any way for me to pull those out of the object completely based on the "type" ?
for example:
{ "result" : {
"field1": "value1",
"field2" : [ "val2", "val3" ],
"field3" : "val4",
"field4" : "val5" }
}
I'd like to be able to remove "field2" because it's an array.
i'm not sure how to iterate through the object in a way that will give me the type of the object.
I'm using C# and JSON.NET 6.0.5
thanks!
After you parse the data do this:
jsonObject.Property("field2").Remove();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With