indexOf

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

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


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

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