Methods by type

Case methods

Full

Upper, lower, title, and per-word case conversions.

Str offers a family of case conversions: .uc/.lc (upper/lower), .tc/.tclc (title-case the first letter), and .wordcase (title-case every word).

Title-casing #

.tc upper-cases the first character; .tclc also lower-cases the rest — useful for normalising a word.

say "hello world".tc;
say "hELLO".tclc;
Output
Hello world
Hello

.tc touches only the first letter, so hello world becomes Hello world (the w stays lower).

wordcase — every word #

.wordcase title-cases each word, not just the first.

say "hello world".wordcase;
Output
Hello World

Notes #