Lipi Reference Lipi

Functions

str.repeat()

Constructs a new string containing the source string repeated repeat times with the separator injected between each repeated instance.

Syntax · 1 of 4

                str.repeat(const string source, const int count, const string separator) → const string
              

Arguments

source required const string String to repeat.
count required const int Number of times to repeat the source string. Must be greater than or equal to 0.
separator const string String to inject between repeated values. Optional. The default is empty string.

Return Type

const string

Syntax · 2 of 4

                str.repeat(input string source, input int count, input string separator) → input string
              

Arguments

source required input string String to repeat.
count required input int Number of times to repeat the source string. Must be greater than or equal to 0.
separator input string String to inject between repeated values. Optional. The default is empty string.

Return Type

input string

Syntax · 3 of 4

                str.repeat(simple string source, simple int count, simple string separator) → simple string
              

Arguments

source required simple string String to repeat.
count required simple int Number of times to repeat the source string. Must be greater than or equal to 0.
separator simple string String to inject between repeated values. Optional. The default is empty string.

Return Type

simple string

Syntax · 4 of 4

                str.repeat(series string source, series int count, series string separator) → series string
              

Arguments

source required series string String to repeat.
count required series int Number of times to repeat the source string. Must be greater than or equal to 0.
separator series string String to inject between repeated values. Optional. The default is empty string.

Return Type

series string

Example


          indicator("String Repeat Example", overlay=false)
str1 = "GoCharting"
repeatedStr = str.repeat(str1, 3)
plot(close, title=repeatedStr)