Returns the specified array item if possible.
public static JToken? TryGetValue(this JToken? jToken, int itemIndex)
parameter | description |
---|---|
jToken | The JToken. |
itemIndex | The index of the array item. |
This method returns null if the JToken is null, or if it doesn’t contain an array, or if the index is out of bounds.
Returns the specified property value if possible.
public static JToken? TryGetValue(this JToken? jToken, string? propertyName)
parameter | description |
---|---|
jToken | The JToken. |
propertyName | The name of the property. |
This method returns null if the JToken is null, or if it doesn’t contain an object, or if the property name is null, or if the property doesn’t exist.