JArray Methods in C#: Complete Guide
In C#, there are several methods to operate on JArrays.
- Add: Append a new JToken object to the JArray.
- Remove: Remove the specified JToken object from the JArray at the specified index position.
- RemoveAt: Remove the JToken object at the specified index position from the JArray.
- Clear: Empty all elements in JArray.
- Check if the specified JToken object is contained in the JArray.
- IndexOf: retrieve the index position of the specified JToken object within the JArray.
- Insert a new JToken object at a specified position in the JArray.
- Count: Get the number of elements in the JArray.
- GetEnumerator: Obtain an enumerator for the JArray, allowing you to iterate through all elements in the JArray.
- ToString: Serialize a JArray into a JSON string.