string.rep()

Type Function
Library string.*
Return value String
Revision Release 2024.3703
Keywords string, rep, replicate
See also String

Overview

Replicates a string by returning a string that is the concatenation of n copies of a specified String.

Syntax

string.rep( s, n )

s:rep( n )
s (required)

String. The string to replicate.

n (required)

Number. Amount of times to replicate the string.

Example

print( string.rep( "Corona ", 5 ) )  --> Corona Corona Corona Corona Corona