c# - counting total objects in JSON Response -
i want count number of objects from response. dont wnat make classes such small purpose , iterating on classes. there shorter way that.
i using both json.net , web.serialization.
this return count of immediate objects in array.
var input = "[{name: 'hello'}, {name: 'hi'}]"; dynamic response = new system.web.script.serialization.javascriptserializer().deserialize<dynamic>(input); response.write(response.length);
Comments
Post a Comment