Get items from a JArray variable

How can I go through a variable of type JArray with a For each, to obtain each of the items it contains?

My jArray variable contains this:


one of many options:

for each type argument set to String:
item in myJArray.ToObject(of String())


1 Like

Hey so this is quite easy :slight_smile: in Json structure usually, you have construct like this:
“name”: “Madame Uppercut”,
“age”: 39,
“secretIdentity”: “Jane Wilson”,
“powers”: [
“Million tonne punch”,
“Damage resistance”,
“Superhuman reflexes”

To access array you have to do JsonOject[powers] → now you are accessing array from now one you can get it by id or iterate jproperty in JArray

1 Like

It Works!!!

Thank you very much!!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.