Method has_index()
- Method
has_index
inthas_index(stringhaystack,intindex)
inthas_index(arrayhaystack,intindex)
inthas_index(mapping|multiset|object|programhaystack,mixedindex)- Description
Search for
indexinhaystack.- Returns
Returns
1ifindexis in the index domain ofhaystack, or0(zero) if not found.This function is equivalent to (but sometimes faster than):
search(indices(haystack), index) != -1- Note
A negative index in strings and arrays as recognized by the index operators
`[]()and`[]=()is not considered a proper index by has_index()- See also
has_value(), has_prefix(), has_suffix(), indices(), search(), values(), zero_type()