str.contains
Tests whether one string occurs inside another. Both arguments are required, and the function carries one signature per form of them.
str.contains(const string source, const string str) → const boolstr.contains(input string source, input string str) → input boolstr.contains(series string source, series string str) → series boolstr.contains(simple string source, simple string str) → simple bool| Parameter | Type | Required | Description |
|---|---|---|---|
source | const string | yes | the string to search in |
str | const string | yes | the string to look 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 contains ES")
plotshape(str.contains(syminfo.ticker, "ES"), title = "Contains ES")See also str.endswith · str.format_time · str.length
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.