| JObjectTryGetValue Method (String, StringComparison, JToken) |
Tries to get the
JToken with the specified property name.
The exact property name will be searched for first and if no matching property is found then
the
StringComparison will be used to match a property.
Namespace:
Newtonsoft.Json.Linq
Assembly:
Newtonsoft.Json (in Newtonsoft.Json.dll) Version: 12.0.1+509643a8952ce731e0207710c429ad6e67dc43db
Syntax public bool TryGetValue(
string propertyName,
StringComparison comparison,
out JToken value
)
Parameters
- propertyName
- Type: SystemString
Name of the property. - comparison
- Type: SystemStringComparison
One of the enumeration values that specifies how the strings will be compared. - value
- Type: Newtonsoft.Json.LinqJToken
The value.
Return Value
Type:
Booleantrue if a value was successfully retrieved; otherwise,
false.
See Also