How to convert a JToken

后端 未结 4 1500
遇见更好的自我
遇见更好的自我 2021-02-19 13:15

I have a JToken with the value {1234}

How can I convert this to an Integer value as var totalDatas = 1234;

var tData = jObject[\"$totalDatas\"];
int tota         


        
4条回答
  •  北海茫月
    2021-02-19 13:54

    You can use the JToken.ToObject() method.

    JToken token = ...;
    int value = token.ToObject();
    

提交回复
热议问题