Small string operations, live results
CEM-QL str: helpers transform slice values without
JavaScript UI code. Edit the inputs to see each result update.
split uses a literal separator and preserves empty fields;
clear the separator to split into Unicode codepoints with an empty field
at each end, as in Rust. Indices count
codepoints, so an emoji such as π occupies one position. These are
CEM functions, not UTF-16 JavaScript methods.
The XPath comparisons load
a separate text-function library.
normalize-space and one-argument tokenize
recognize only XML spaces, tabs, CR and LF. Non-breaking spaces
remain text. Native str:normalize_space(text, "xml")
now provides the same whitespace profile; omitting it preserves
CEM-QL's Unicode-whitespace normalizer.
string-join inserts a literal separator between tokens;
repeated words remain, and blank input yields an empty string.
See also
Shared XPath function libraries
XPath sequence windows and distinct words