str.startswith
The counterpart of str.endswith, looking at the front of the string instead of the back. Both arguments are required.
str.startswith(const string source, const string prefix) → const boolstr.startswith(input string source, input string prefix) → input boolstr.startswith(series string source, series string prefix) → series boolstr.startswith(simple string source, simple string prefix) → simple bool| Parameter | Type | Required | Description |
|---|---|---|---|
source | const string | yes | the string being examined |
prefix | const string | yes | the opening to test for |
Returns const bool or input bool or series bool or simple bool — A bool in the form of the arguments you pass.
indicator("Ticker starts with BTC")
plotshape(str.startswith(syminfo.ticker, "BTC"), title = "Starts with BTC")See also str.contains · str.endswith · str.format_time
Part of the function index.
Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.