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. Returnsnull if input is null.
Examples
Example 1: Basic Repetition
Example 2: Creating Separators
Example 3: Building Star Ratings
Example 4: Indentation
Notes
- Returns
nullif input isnull - 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 - Pad the start of a string
- text.rpad - Pad the end of a string
- text.format - Format strings with placeholders
Frequently Asked Questions
What does flex.text.repeat return if count is 0?
What does flex.text.repeat return if count is 0?
It returns an empty string
''.Can I repeat multi-character strings?
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'.