# indexOf

Source: https://taxilang.org/docs/language/stdlib/indexOf

**Full name:** `taxi.stdlib.indexOf`

## Signature

```taxi
declare extension function indexOf(source:String, valueToSearchFor:String):Int
```

## Description

Returns the zero-based index of `valueToSearchFor` within `source`, or `-1` if not found.

```taxi
find { path: FilePath } as {
   dotPosition: Int = path.value.indexOf('.')
}
```

## Examples

Returns the index of a substring within a string, or `-1` if not found.

Query:

```taxi
find {
   pos: Int = indexOf('Hello World', 'World')
}
```

Result:

```json
{
  "pos": 6
}
```
