json_list_str_index()
#
The function json_list_str_index()
searches for a string in a JSON array and returns its index if found, or -1 if not found.
Prototype
int json_list_str_index(
json_t *jn_list,
const char *str,
BOOL ignore_case
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
A JSON array to search within. |
|
|
The string to search for in the JSON array. |
|
|
If |
Return Value
Returns the index of the string in the JSON array if found, or -1 if not found.
Notes
The function expects jn_list
to be a JSON array. If jn_list
is not an array, an error is logged.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples