@tempots/std
repeatString() function
repeatString
builds a new string by repeating the argument s
, n times
.
Signature:
repeatString: (s: string, times: number) => string
Parameters
Parameter |
Type |
Description |
---|---|---|
s |
string |
The string to repeat. |
times |
number |
The number of times to repeat the string. |
Returns: string
The repeated string.
Example
repeatString('Xy', 3) // generates 'XyXyXy'