# LOCATE

Returns an integer indicating the position of a substring within another string. If the substring is not found, it returns `0`. Note that string positions start from `1`.

## Syntax

`LOCATE(string, substring, start)`

### Parameters

#### `string`

An input string.

#### `substring`

A substring to locate within the input string.

#### `start`

The start index. This parameter is optional.

## Examples

Locate a substring within a string

```esql
ROW a = "hello"
| EVAL a_ll = LOCATE(a, "ll")
```

This example finds the position of the substring `"ll"` within the string `"hello"`. The result is `3`.

## Notes

- String positions start from `1`.
- If the substring cannot be found, the function returns `0`.
