JSONValue.opBinaryRight

Support for the in operator.

Tests wether a key can be found in an object.

struct JSONValue
const @safe
opBinaryRight
(
string op : "in"
)
(
string k
)

Return Value

Type: auto

when found, the const(JSONValue)* that matches to the key, otherwise null.

Throws

JSONException if the right hand side argument JSONType is not object.

Examples

JSONValue j = [ "language": "D", "author": "walter" ];
string a = ("author" in j).str;

Meta

Suggestion Box / Bug Report