getString


Description:

public static string getString (JsonValue root, string path, string fallback = "")

Returns a string value at the given path with a fallback.

Example:

    string name = Json.getString (root, "$.user.name", "unknown");

Parameters:

root

root value.

path

JSON path expression.

fallback

value to return if path not found or type mismatch.

Returns:

string value or fallback.