Lipi Reference Lipi

Functions

str.startswith()

The counterpart of str.endswith, looking at the front of the string instead of the back. Both arguments are required.

Syntax · 1 of 4

                str.startswith(const string source, const string prefix) → const bool
              

Arguments

source required const string the string being examined
prefix required const string the opening to test for

Return Type

const bool

Syntax · 2 of 4

                str.startswith(input string source, input string prefix) → input bool
              

Arguments

source required input string the string being examined
prefix required input string the opening to test for

Return Type

input bool

Syntax · 3 of 4

                str.startswith(simple string source, simple string prefix) → simple bool
              

Arguments

source required simple string the string being examined
prefix required simple string the opening to test for

Return Type

simple bool

Syntax · 4 of 4

                str.startswith(series string source, series string prefix) → series bool
              

Arguments

source required series string the string being examined
prefix required series string the opening to test for

Return Type

series bool

Example


          indicator("String StartsWith Example", overlay=false)
myStr = "GoCharting is awesome!"
doesStart = str.startswith(myStr, "GoCharting")
plot(doesStart ? 1 : 0, title="Starts with 'GoCharting'")