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

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -