string json = "{\"users\":[{\"name\":\"John\",\"age\":30},{\"name\":\"Jane\",\"age\":25}]}"; JObject obj = JObject.Parse(json); JArray users = (JArray)obj["users"];
string json = "{\"name\":\"John\",\"age\":30,\"hobbies\":[\"reading\",\"gaming\",\"cooking\"]}"; JObject obj = JObject.Parse(json); JArray hobbies = (JArray)obj["hobbies"];In this example, we have a JSON object with a "hobbies" array that contains three strings (reading, gaming, and cooking). Again, we use the JObject.Parse method to parse the JSON string into a JObject and use the GetArray method to retrieve the "hobbies" array from the JObject and cast it to a JArray. The package library for using the GetArray method in C# is Newtonsoft.Json.