I widely use the SuperObject
JSON library. I need to be able to check if a particular element exists in an object or not. I can check the value of an element, for example an integer that doesn't exist returns 0
. However, 0
is one of the possible values if it does exist - so I can't depend on observing 0
for the element's existence. I checked the ISuperObject
for methods that can do this (for example I'd expect something like ISuperObject.Exists(const S: String): Boolean;
), but see nothing like this.
How can I check if a particular element exists in the JSON object or not?
if obj.AsObject.Exists('AreYouThere?') then
? – CarolusTSuperObject.AsObject
is of typeTSuperTableString
, which has anExists()
function. – CarolusInheritedFieldExist
– Resentful