repeat
Modified on Wed, 02 Aug 2023
Description
Repeat the given string n times
Syntax
repeat(text, numberOfTimes)
Parameters
Input Parameter | Type | Description |
---|---|---|
text | string | The string to repeat. |
numberOfTimes | number | The number of times to repeat the string |
Return value
Type |
---|
string |
Sample
Example | Result | Description |
---|---|---|
repeat('invoice ', 2) | 'invoice invoice ' | Repeat the string 2 times |
repeat('*', 4) | '****' | Using repeat function for masking the text |
To view all the String functions, click here.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article