padStart

Full name: taxi.stdlib.padStart

Signature

declare extension function padStart(input: String, length: Int, padWith: String):String

Description

Pads the string to the specified total length by prepending padWith characters at the start.

padWith should be a single character — if multiple characters are passed, only the first is used.

find { order: Order } as {
   paddedId: String = order.id.padStart(8, '0')
}

Examples

Zero-pads a short string to the target length from the left.

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