Sidechair

str.lower()

Browse the reference

Returns a string with every letter converted to lower case.

Try it in the editor

str.lower changes upper-case letters to lower case and leaves digits, symbols and spaces alone.

Normalise case before comparing text, because str.contains and the other string tests are case-sensitive.

Syntax

Pine Script
str.lower(source: const string) -> const string
str.lower(source: simple string) -> simple string
str.lower(source: series string) -> series string

Arguments

NameTypeDefaultDescription
sourceconst/simple/series stringrequiredThe text to turn into lower case. Characters without a case stay as they are.

Returns

const/simple/series string: the lower-case text.

Remarks

Example

Pine ScriptCase-insensitive testOpen in editor
//@version=6
indicator("Lower")
same = str.lower(syminfo.ticker) == "nvda"
plot(same ? 1 : 0, "Is NVDA", color = color.green, style = plot.style_stepline)

See also

Runs on Sidechair