Repeat string

Supported in: Batch, Faster

Repeats a string the given number of times. A count of zero or less gives an empty string.

Expression categories: String

Declared arguments

  • Count: The number of times to repeat the string.
    Expression<Integer>
  • Expression: The string to repeat.
    Expression<String>

Output type: String

Examples

Example 1: Base case

Argument values:

  • Count: 3
  • Expression: ab

Output: ababab


Example 2: Null case

Argument values:

  • Count: count
  • Expression: string
stringcountOutput
null2null
abnullnull
nullnullnull

Example 3: Edge case

Description: A count of zero or less gives an empty string.

Argument values:

  • Count: count
  • Expression: string
stringcountOutput
ab1ab
ab0empty string
ab-2empty string
empty string5empty string