REPT

REPT repeats a string a given number of times.

Function category: Text

Syntax

REPT(arg1, arg2)

Arguments

Description

arg1

String to be repeated.

arg2

Number of repetitions.

Examples

Example 1:

Let's say we get a response with a string with the following product information:

{
"data":{
"product_code": "2zf13"
}
}

If an endpoint requires that we repeat it twice, we can use REPT:

REPT(data.trip.product_code, 2)

This returns the following:

"2zf132zf13"