repeat

Modified on Wed, 02 Aug 2023

Description

Repeat the given string n times

Syntax

repeat(text, numberOfTimes)

Parameters

Input ParameterTypeDescription
textstringThe string to repeat.
numberOfTimesnumberThe number of times to repeat the string

Return value

Type
string

Sample

ExampleResultDescription
repeat('invoice ', 2)'invoice invoice 'Repeat the string 2 times
repeat('*', 4)'****'Using repeat function for masking the text

To view all the String functions, click here.