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

# text.repeat

> Returns a string repeated a specified number of times.

## Description

Repeats a string a specified number of times.

## Syntax

```cypher theme={null}
flex.text.repeat(string, count)
```

## Parameters

| Parameter | Type   | Required | Description                              |
| --------- | ------ | -------- | ---------------------------------------- |
| `string`  | string | Yes      | The string to repeat                     |
| `count`   | number | Yes      | The number of times to repeat the string |

## Returns

**Type:** string

A new string consisting of the input string repeated the specified number of times. Returns `null` if input is `null`.

## Examples

### Example 1: Basic Repetition

```cypher theme={null}
RETURN flex.text.repeat('Ha', 3) AS result
```

**Output:**

```text theme={null}
result
------
HaHaHa
```

### Example 2: Creating Separators

```cypher theme={null}
RETURN flex.text.repeat('-', 40) AS separator
```

**Output:**

```text theme={null}
separator
----------------------------------------
----------------------------------------
```

### Example 3: Building Star Ratings

```cypher theme={null}
MATCH (r:Review)
RETURN r.product, flex.text.repeat('★', r.rating) AS stars
```

**Output:**

```text theme={null}
product     | stars
------------|-------
Laptop      | ★★★★★
Mouse       | ★★★★
Keyboard    | ★★★
```

### Example 4: Indentation

```cypher theme={null}
WITH 2 AS level
RETURN flex.text.repeat('  ', level) + 'Nested Item' AS indented
```

**Output:**

```text theme={null}
indented
----------------
    Nested Item
```

## Notes

* Returns `null` if input is `null`
* Count must be a non-negative integer
* Useful for creating visual elements, separators, or formatting
* Can be combined with other text functions for complex formatting

## See Also

* [text.lpad](/udfs/flex/text/lpad) - Pad the start of a string
* [text.rpad](/udfs/flex/text/rpad) - Pad the end of a string
* [text.format](/udfs/flex/text/format) - Format strings with placeholders

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="What does flex.text.repeat return if count is 0?">
    It returns an empty string `''`.
  </Accordion>

  <Accordion title="Can I repeat multi-character strings?">
    Yes. The function repeats the entire input string, not just a single character. For example, `flex.text.repeat('Ha', 3)` returns `'HaHaHa'`.
  </Accordion>
</AccordionGroup>
