Lipi Reference Lipi

Functions

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.

Syntax · 1 of 4

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

Arguments

source required const string the string to repeat
count required const int how many copies to produce
separator const string optional text to place between the copies

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 the string to repeat
count required input int how many copies to produce
separator input string optional text to place between the copies

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 the string to repeat
count required simple int how many copies to produce
separator simple string optional text to place between the copies

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 the string to repeat
count required series int how many copies to produce
separator series string optional text to place between the copies

Return Type

series string

Example


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