> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reelevant.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pad

> Pad a string to a target length

## Overview

The `pad` transformation pads a string to a target length by adding a fill character at the start or end.

## Syntax

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
pad(<variable>, type="start", expectedLength=10, fill="0")
```

## Parameters

| Parameter        | Type   | Required | Description                             |
| ---------------- | ------ | -------- | --------------------------------------- |
| `variable`       | string | Yes      | The string to pad                       |
| `type`           | string | Yes      | Padding direction: `"start"` or `"end"` |
| `expectedLength` | number | Yes      | The target length of the output string  |
| `fill`           | string | Yes      | The character(s) used to pad the string |

## Examples

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
pad(<variable>, type="start", expectedLength=5, fill="0")
pad(<variable>, type="end", expectedLength=20, fill=" ")
```
