Lipi Reference Lipi

Functions

str.trim()

Constructs a new string with all consecutive whitespaces and other control characters (e.g., “ ”, “ ”, etc.) removed from the left and right of the source.

Syntax · 1 of 4

                str.trim(const string source) → const string
              

Arguments

source required const string String to trim.

Return Type

const string

Syntax · 2 of 4

                str.trim(input string source) → input string
              

Arguments

source required input string String to trim.

Return Type

input string

Syntax · 3 of 4

                str.trim(simple string source) → simple string
              

Arguments

source required simple string String to trim.

Return Type

simple string

Syntax · 4 of 4

                str.trim(series string source) → series string
              

Arguments

source required series string String to trim.

Return Type

series string

Example


          indicator("String Trim Example", overlay=false)
strWithSpaces = "GoCharting"
trimmedStr = str.trim(strWithSpaces)
plot(close, title=trimmedStr)