Reference · Strings

lower

signature
lower(str) -> str

What it does

The text in lower case. It knows all of Unicode, so letters outside ASCII are converted too: Greek, Cyrillic and accented letters alike. Digits, punctuation and whitespace stay as they are.

Examples

print(lower("HELLO"))print(lower("ÆRØ 42, OK?"))print(lower("ΑΒΓ"), lower("Straße"))
output
helloærø 42, ok?αβγ straße

Edge cases

print(lower(""), len(lower("İ")))print(lower("ΣΑΣ"))print(upper("ß") | lower)print(lower("Ab") == lower("aB"))
output
 2σαςsstrue

Errors

An argument that is not a string is a runtime error, not an error value: lower(42) stops the request. Convert first with str.

this one fails
print(lower(42))
output
line 1: `lower` expects a str as argument 1, got int

Chaining

In a pipeline the text comes first, so lower takes it as its only argument:

print("  Mixed Case  " | trim | lower)print(["Ann", "BOB"] | map(lower))print(["img.png", "a.jpg", "b.PNG"] | filter((f) => lower(f) | ends_with(".png")))
output
mixed case["ann", "bob"]["img.png", "b.PNG"]

See also

upper, trim, str

Thread
6Useful? Like it, or add to its thread below.

Thread 0 posts

On lower(): questions, tips, corrections, and code that uses it.

No posts yet. The first one opens the thread.

    Edit this page on GitHub · every example's output was made by running it (tools/refcheck.mjs) · questions on Discord or r/quillo