Jaume
Jaume

Reputation: 3800

Get the length of a deserialized object array

I've got following object structure from a JSON deserialization. Then, I can access properly to its values, but how can I get the length of an Object array using a specific key? I need to get length shown in the picture like jsonDes("result").length.

enter image description here

Upvotes: 0

Views: 1640

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039248

The following will just print the expected result using VB.NET dynamic features:

Dim jsonDes As Object = New JavaScriptSerializer().DeserializeObject(...)
Dim length As Integer = jsonDes("result").length
Console.WriteLine(length)

Upvotes: 1

Related Questions