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

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -