> ## 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

> Compléter une chaîne jusqu'à une longueur cible

## Présentation

La transformation `pad` complète une chaîne jusqu'à une longueur cible en ajoutant un caractère de remplissage au début ou à la fin.

## Syntaxe

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

## Paramètres

| Paramètre        | Type   | Requis | Description                                            |
| ---------------- | ------ | ------ | ------------------------------------------------------ |
| `variable`       | string | Oui    | La chaîne à compléter                                  |
| `type`           | string | Oui    | Direction du remplissage : `"start"` ou `"end"`        |
| `expectedLength` | number | Oui    | La longueur cible de la chaîne en sortie               |
| `fill`           | string | Oui    | Le ou les caractères utilisés pour compléter la chaîne |

## Exemples

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