json class : IsNull(string) method

Description

Gets a value indicating whether a value corresponding to the member name is null.

Syntax

jsonInstance.IsNull(string memberName)

Arguments

ClassNameDescription
stringmemberNameA member name.

Return value

ClassDescription
boolA value indicating whether a value is null.

Sample code

1:

json jsonIns = new json("{@name@:@suzuki@,@age@:1,@address@:null}".Replace("@","".DQ));

2:

bool isnull = jsonIns.IsNull("name"); // false

3:

isnull = jsonIns.IsNull("age"); // false

4:

isnull = jsonIns.IsNull("address"); // true

Notes

If the instance is an JSON array, an exception is raised.

If there is no member corresponding to the member name, an exception is raised.

Only members that are direct children are searched.

Returns true if a value corresponding to the member name is null. Otherwise it returns false.

Links for reference

None

Copyright © Cooker All rights reserved.