Get Length of array JSON.Net

前端 未结 5 1385
失恋的感觉
失恋的感觉 2020-12-15 03:13

How can I get the length of a JSON Array I get using json.net in C#? After sending a SOAP call I get a JSON string as answer, I use json.net to parse it.

Example of

5条回答
  •  心在旅途
    2020-12-15 03:18

    You can use below line to get the length of JSON Array in .Net (JArray) .

     int length = ((JArray)test["jsonObject"]).Count;
    

提交回复
热议问题