indexOf

open fun indexOf(@NonNull keyword: Expression, @NonNull input: Expression): Expression

Returns the first position at which a `needle` can be found in a `haystack`.

Return

position in the array or string or -1 if not found.

Parameters

needle

the item expression

haystack

the array or string expression

See also

<a href="https://maplibre.org/maplibre-style-spec/expressions/#index-of">Style specification</a>

open fun indexOf(@NonNull keyword: Expression, @NonNull input: Expression, @NonNull fromIndex: Expression): Expression

Returns the first position at which a `needle` can be found in a `haystack`.

Return

position in the array or string or -1 if not found.

Parameters

needle

the item expression

haystack

the array or string expression

fromIndex

the index to start searching from

See also

<a href="https://maplibre.org/maplibre-style-spec/expressions/#index-of">Style specification</a>