How to reverse JToken values? I have a JToken as input and need to have JToken as output.
A can do “jtoken.Reverse()“, but this method returns IEnumerable<JToken>
Example of JToken:
{
"response": [
{
"body": "steel",
"can_fly": 1,
"hover": 1
},
….many many items
This return value means that
Reverse()does not create a new array (or whatever kind of collection yourjtokenis) but an iterator that will yield elements in the reverse order.If you just need to iterate over the tokens then do so: