Lipi Reference Lipi

Functions

str.substring()

Cuts a piece out of a string. There are two forms: one takes a start and an end, the other takes a start alone. Positions are ints. This edition does not state what they are counted from, or whether the end position is included in the result.

Syntax · 1 of 8

                str.substring(const string source, const int start, const int end) → const string
              

Arguments

source required const string the string to cut from
start required const int the position the returned piece starts at
end required const int the position the returned piece runs to, in the three-argument form

Return Type

const string

Syntax · 2 of 8

                str.substring(input string source, input int start, input int end) → input string
              

Arguments

source required input string the string to cut from
start required input int the position the returned piece starts at
end required input int the position the returned piece runs to, in the three-argument form

Return Type

input string

Syntax · 3 of 8

                str.substring(simple string source, simple int start, simple int end) → simple string
              

Arguments

source required simple string the string to cut from
start required simple int the position the returned piece starts at
end required simple int the position the returned piece runs to, in the three-argument form

Return Type

simple string

Syntax · 4 of 8

                str.substring(series string source, series int start, series int end) → series string
              

Arguments

source required series string the string to cut from
start required series int the position the returned piece starts at
end required series int the position the returned piece runs to, in the three-argument form

Return Type

series string

Syntax · 5 of 8

                str.substring(const string source, const int start) → const string
              

Arguments

source required const string the string to cut from
start required const int the position the returned piece starts at

Return Type

const string

Syntax · 6 of 8

                str.substring(input string source, input int start) → input string
              

Arguments

source required input string the string to cut from
start required input int the position the returned piece starts at

Return Type

input string

Syntax · 7 of 8

                str.substring(simple string source, simple int start) → simple string
              

Arguments

source required simple string the string to cut from
start required simple int the position the returned piece starts at

Return Type

simple string

Syntax · 8 of 8

                str.substring(series string source, series int start) → series string
              

Arguments

source required series string the string to cut from
start required series int the position the returned piece starts at

Return Type

series string

Example


          indicator("String Substring Example", overlay=false)
myStr = "GoCharting is powerful"
subStr = str.substring(myStr, 0, 10)
plot(close, title=subStr)