JObjectExtensions.GetString method

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Json.Extensions
Assembly Skybrud.Essentials.dll

GetString(JObject, string)

Extension method

Gets the string value of the token matching the specified path, or null if path doesn't match a token.

public static string GetString(this JObject obj, string path)

Parameters

obj JObject

The parent object.

path String

A String that contains a JPath expression.

Returns

An instance of String , or null.

GetString<T>(JObject, string, Func<T, TResult>)

Extension method

Gets the value of the token matching the specified path, or null if path doesn't match a token.

public static T GetString<T>(this JObject obj, string path, Func<T, TResult> callback)

Type Parameters

T

Parameters

obj JObject

The parent object.

path String

A String that contains a JPath expression.

callback Func<T, TResult>

The callback used for converting the string value.

Returns

T

An instance of T, or null.