Returns a string with every letter converted to upper case.
str.upper changes lower-case letters to upper case. Digits, symbols and spaces stay as they are.
Use it to display a tidy label from user text, or to compare against an upper-case constant.
Syntax
str.upper(source: const string) -> const string
str.upper(source: simple string) -> simple string
str.upper(source: series string) -> series stringArguments
| Name | Type | Default | Description |
|---|---|---|---|
| source | const/ | required | The text to turn into upper case. Characters without a case stay as they are. |
Returns
const/simple/series string: the upper-case text.
Remarks
- It does not trim spaces. Combine it with
str.trimfor cleaned input.
Example
//@version=6
indicator("Upper")
code = input.string("nvda", "Code")
plot(str.upper(code) == syminfo.ticker ? 1 : 0, "Matches chart", color = color.orange, style = plot.style_stepline)See also
Runs on Sidechair