str.repeat
Produces a string made of repeated copies of another, with the option of something between the copies. The string and the count are required; the separator is not.
str.repeat(const string source, const int count, const string separator) → const stringstr.repeat(input string source, input int count, input string separator) → input stringstr.repeat(series string source, series int count, series string separator) → series stringstr.repeat(simple string source, simple int count, simple string separator) → simple string| Parameter | Type | Required | Description |
|---|---|---|---|
source | const string | yes | the string to repeat |
count | const int | yes | how many copies to produce |
separator | const string | no | optional text to place between the copies |
Returns const string or input string or series string or simple string — A string in the form of the arguments you pass.
indicator("Repeated text")
alert(str.repeat("ab", 3))
plot(close)See also str.contains · str.endswith · str.format_time
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.