Indexof

indexof

Returns the zero-based index of the first occurrence of a lookup string within a source string.

Spec

indexof(source, lookup)

Parameters

source - The string to search in.
lookup - The string to search for.

Return Value

An int64: the zero-based index of the first match, or -1 if not found.

Example

datatable(val:string)["hello world"]
| extend idx = indexof(val, "world")
validx
hello world6