New in Formulas 2.0
The repeat()
function will repeat a string the specified number of times.
repeat(string, number) string.repeat(number)
If you specify a non-string data type as the first argument, it will be converted to a string before being repeated.
123.repeat(3) /* Output: "123123123" */
false.repeat(3) /* Output: "falsefalsefalse" */
Example Formulas
"This is " + "very ".repeat(3).split(" ").join(", ") + " good."