Skip to main content

Description

Repeats a string a specified number of times.

Syntax

Parameters

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

Output:

Example 2: Creating Separators

Output:

Example 3: Building Star Ratings

Output:

Example 4: Indentation

Output:

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

Frequently Asked Questions

It returns an empty string ''.
Yes. The function repeats the entire input string, not just a single character. For example, flex.text.repeat('Ha', 3) returns 'HaHaHa'.