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

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 a value twice, we can use the following function.

# Repeat a value as specified in arg2
REPT(data.trip.product_code, 2)
# Returns "2zf132zf13"