# mid

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

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

## Signature

```taxi
declare extension function mid(source: String, startIndex: Int, endIndex: Int):String
```

## Description

Returns the middle of a string, starting at `startIndex` (inclusive) and ending just before `endIndex` (exclusive).

Uses zero-based indexing, identical to `String.substring()` in Java/Kotlin.

```taxi
find { order: Order } as {
   yearPart: String = order.isoDate.mid(0, 4)
}
```

## Examples

Extracts a substring using a zero-based start index (inclusive) and end index (exclusive).

Query:

```taxi
find {
   mid5: String = mid('HelloWorld', 5, 10)
}
```

Result:

```json
{
  "mid5": "World"
}
```
