MAIN{let's':="héllo 👨👩👧 wörld";# a text has no single length — say which unit (decided 2026-09-20)std::print.useful[str.bytes[lend's']," bytes, ",str.points[lend's']," points, ",str.graphemes[lend's']," graphemes",newln];# walking a text says the unit toolet'vowels':=0;for'g'instr.each.grapheme[lend's']{if'g'equal_to`o`or'g'equal_to`e`{change'vowels'='vowels'plus1;}}std::print.useful['vowels'," vowels",newln];# the toolbox is std'slet'words':=std::str.split[lend's',at" "];std::print.useful[list.length[lend'words']," words; first is ",'words'[pos1],newln];std::print.useful[std::str.upper[lend's'],newln];std::print.useful[std::str.contains[lend's',part"wör"]," ",std::str.starts_with[lend's',part"hé"],newln];let'third':=std::str.at.grapheme[lend's',pos3]otherwise`?`;let'family':=std::str.at.grapheme[lend's',pos7]otherwise`?`;std::print.useful['third'," ",'family',newln];let'where':=std::str.find.grapheme[lend's',part"wör"]otherwise0;std::print.useful["wör starts at grapheme ",'where',newln];let'head':=std::str.slice.grapheme[lend's',frompos1,topos5]otherwisestr.empty;std::print.useful['head',newln];std::print.useful[std::str.join[lend'words',between"_"],newln];}
Output
32 bytes, 17 points, 13 graphemes
1 vowels
3 words; first is héllo
HÉLLO 👨👩👧 WÖRLD
true true
l 👨👩👧
wör starts at grapheme 9
héllo
héllo_👨👩👧_wörld