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

> ## Agent Instructions
> FalkorDB is a graph database that speaks the Redis protocol. Queries are issued as OpenCypher through the GRAPH.QUERY and GRAPH.RO_QUERY commands, not over Bolt or a SQL connection.
> FalkorDB implements a subset of OpenCypher with proprietary extensions. Do not assume Neo4j-only syntax or procedures are available — check /cypher/cypher-support and /cypher/known-limitations before using a clause.
> FalkorDB is the successor to RedisGraph, but they are separate products. Do not present RedisGraph commands, versions, or limitations as current FalkorDB behavior.
> Use the official clients listed in /getting-started/clients rather than generic Redis or Neo4j drivers, and prefer the language the user is already working in.
> Configuration parameters are set with GRAPH.CONFIG SET or at startup; cite the exact parameter name from /getting-started/configuration rather than inventing one.
> This site covers four products: FalkorDB (core), FalkorDB Cloud, FalkorDB Enterprise, and the GraphRAG SDK. Name which one an answer applies to, since setup and operations differ.

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