str.length

Gives the length of a string as an int. One argument, required. The unit the length is counted in is not stated in this edition.

str.length(const string source) → const int
str.length(input string source) → input int
str.length(series string source) → series int
str.length(simple string source) → simple int
ParameterTypeRequiredDescription
sourceconst stringyesthe string to measure

Returns const int or input int or series int or simple int — An int in the form of the argument you pass.

indicator("Length of the ticker")
plot(str.length(syminfo.ticker))

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.
Upgrade