Functions
str.startswith()
Returns true if the source string starts with the substring specified in str, false otherwise.
Syntax · 1 of 4
str.startswith(const string source, const string prefix) → const bool
Arguments
source required const string Source string. prefix required const string The substring to search for. Return Type
const bool Syntax · 2 of 4
str.startswith(input string source, input string prefix) → input bool
Arguments
source required input string Source string. prefix required input string The substring to search for. Return Type
input bool Syntax · 3 of 4
str.startswith(simple string source, simple string prefix) → simple bool
Arguments
source required simple string Source string. prefix required simple string The substring to search for. Return Type
simple bool Syntax · 4 of 4
str.startswith(series string source, series string prefix) → series bool
Arguments
source required series string Source string. prefix required series string The substring to search 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'")