# repeat

[Read this page in HTML](https://www.scopedb.io/docs/reference/functions/string/repeat)

Repeats a string a specified number of times.

## Syntax

```scopeql
repeat(<string>, n => <n>)
```

## Arguments

| Argument   | Type     | Description                                                |
| ---------- | -------- | ---------------------------------------------------------- |
| `<string>` | `string` | String to repeat.                                          |
| `n`        | `int`    | Constant. Non-negative repetition count. Must not be NULL. |

## Returns

Returns `string`. A count of 0 returns an empty string. Returns NULL if the input is NULL.

## Examples

Repeat a dash to separate fields in a text label:

```scopeql
SELECT 'Checkout failures ' || repeat('-', n => 12) AS heading
```

```text
+--------------------------------+
| heading                        |
+--------------------------------+
| Checkout failures ------------ |
+--------------------------------+
```
