str.repeat() - Pine Script Function
str.repeat()
Section titled “str.repeat()”Overview
Section titled “Overview”Constructs a new string containing the source string repeated repeat times with the separator injected between each repeated instance.
Syntax
Section titled “Syntax”str.repeat(source, repeat, separator) → const stringParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| source | const string | String to repeat. |
Remarks
Section titled “Remarks”- Returns na if the source is na.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("str.repeat")repeat = str.repeat("?", 3, ",") // Returns "?,?,?"label.new(bar_index,close,repeat)