Repeats a string a specified number of times.
repeat(x:string, n:int) -> stringDescription
Section titled “Description”The repeat function returns a new string consisting of x repeated n times.
If n is 0, the function returns an empty string.
x: string
Section titled “x: string”The string to repeat.
n: int
Section titled “n: int”The number of times to repeat x. Must be non-negative.
Examples
Section titled “Examples”Repeat a string
Section titled “Repeat a string”from {message: "na".repeat(8)}{message: "nananananananana"}Repeat zero times
Section titled “Repeat zero times”from {message: "na".repeat(0)}{message: ""}