The Loon string builtins cover the basics (uppercase, lowercase,
trim, split, join, replace, starts-with?, ends-with?,
contains?, index-of, substring, char-at, len), but a few
common operations are missing:
capitalize — uppercase first character, lowercase the rest
pad-left / pad-right — pad a string to a target width
repeat — repeat a string N times (e.g. [repeat "-" 10])
The modules guide shows capitalize as an example user function,
suggesting demand.
Acceptance criteria
- Builtins available in the VM and documented in
ref/builtins.loon.
- Tests for empty strings, unicode strings, and width-shorter-than-input
for the pad functions.
The Loon string builtins cover the basics (
uppercase,lowercase,trim,split,join,replace,starts-with?,ends-with?,contains?,index-of,substring,char-at,len), but a fewcommon operations are missing:
capitalize— uppercase first character, lowercase the restpad-left/pad-right— pad a string to a target widthrepeat— repeat a string N times (e.g.[repeat "-" 10])The modules guide shows
capitalizeas an example user function,suggesting demand.
Acceptance criteria
ref/builtins.loon.for the pad functions.