REPT
function REPT(arg1: string = null, arg2: number = null): string
Description
Repeats text a given number of times. Use this function to fill a cell with a number of instances of a text string.
Parameters
- arg1
string
null The text that will be repeated.
- arg2
number
null A positive number specifying the number of times to repeat text.
Returns
string
Try It
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.REPT("Text", 3));