String
String module: functions for working with UTF-8 encoded strings.
March strings are immutable UTF-8 byte sequences. The runtime uses a fat-pointer representation with small-string optimisation (SSO): strings of 15 bytes or fewer are stored inline without a heap allocation.
Key naming conventions:
- Functions with
byte_in their name operate on raw byte offsets (O(1)). - Functions without a prefix count graphemes (human-perceived characters).
- Use
byte_sizefor performance-critical paths; usegrapheme_countwhen
the result must match what a user sees on screen.