Sign in Join
FPDoc Onlineexperiment

TJSONObject.IndexOfName function

Member of TJSONObjectpublicIn unit fpJson

Return index of name in item list.

Declaration

pascal
function IndexOfName(const AName: TJSONStringType; 
 CaseInsensitive: Boolean=False): Integer

Arguments

AName

Name to search for.

CaseInsensitive

Search case-insensitively or not ?

Function result

Index of AName in the array, or -1.

Description

IndexOfName compares the names of all elements in the object with AName and returns the index (in the Items property) of the element instance whose name matched AName. If none of the element's names match, the function returns -1.

Since JSON is a case-sensitive specification, the names are searched case-sensitively by default. This can be changed by setting the optional CaseInsensitive parameter to True

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.