Getting access to ArrayList object

前端 未结 2 502
天命终不由人
天命终不由人 2021-01-27 23:19

I\'m developing an application that reads some JSON data and makes some statistics, but now I\'ve run into a problem.

I have a string like this:

{
\"posi         


        
2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-27 23:56

    You can access the elements as follows:

    LinqPad Demo

    var enumerable = (IEnumerable)values["position"]; // Will get you the enumerable ArrayList
    (Dictionary)values["position"][0]; // Will get you the First element of the ArrayList
    (string)values["position"][0]["someKey1"]; // Will get you someKey1 from the first position of position
    

提交回复
热议问题