Qu

upper

Builtin index · Collections & strings

result = upper(s)

Input: s · Output: result

What it is

s is a Str. Unicode-aware uppercase conversion.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = upper(s)
s Strnot documented yet
result Str
Returns a Str the same length (in characters).

Examples

From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.

s = "  Measurement Lane  "
print("[{trim(s)}]")              # [Measurement Lane]

print(upper(trim(s)))             # MEASUREMENT LANE

print(contains(s, "Lane"))        # true

print(replace(s, "Lane", "Window"))
output
[Measurement Lane]
MEASUREMENT LANE
true
  Measurement Window  

from agent-guide

s = "  Hello, Qu World!  "
trimmed = trim(s)
parts = split(trimmed, ", ")
print(parts)                  # ["Hello", "Qu World!"]

print(upper(parts[0]))        # HELLO

print(starts_with(trimmed, "Hello"))  # true

print("hello".substr(0, 2).replace("e", "i").flip().flip())
print("hi world".split(" ").join(", ") + "!")
output
("Hello", "Qu World!")
HELLO
true
hi
hi, world!

from collections-strings

How it works

ucase/lcase are BASIC's names and toupper/tolower are C's. Both are what a hand reaches for before it reaches for the documentation, and an alias costs a line.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.