mid

Full name: taxi.stdlib.mid

Signature

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.

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).

Try it out

Schema
Query Plan
Play with this snippet by editing it here, or edit it on Taxi Playground
Result
Query failed
Next
Welcome to Taxi