Module string

Source

Functions§

char_at
char_at_pos
char_to_lower
char_to_upper
explode_esc
explode_escaped
format_percentage
int_arr_from_str_printed_arr
Parse a space-delimited string of decimal integers (the inverse of str_print_arr<int>). Accepts optional trailing space. Rejects any non-digit / non-space characters.
len_str
reverse_str
set_char_at
str_char
str_char_at_pos
str_contains_only_int
str_empty
str_from_byte_array
Build a string from raw bytes (each byte -> U+00XX).
str_join_esc
Convenience wrapper.
str_join_esc_no_trailing
Join escaped but remove trailing separator.
str_join_escaped
Join with escaping: occurrences of the separator in any element are preceded by a backslash. A separator is appended after each element (trailing).
str_nonempty
str_replace_once
strReplace(str, find, replace) – JS version used String.replace with first occurrence. We replicate first occurrence behavior.
str_split
Basic (non-escaped) split replicating the original StageL strSplit. Unlike str.split(sep) in many languages, this custom implementation:
str_split_esc
Convenience wrappers retained for compatibility naming.
str_split_escaped
Escape-aware split:
str_to_byte_array
Convert string to vector of raw bytes (0..=255) treating each char’s codepoint (0..=255). For bytes above ASCII range, the direct low-byte value of the char is used (mirroring JS charCodeAt & 0xFF).
str_to_lower
str_to_upper
substring_bug_compatible
Index into a substring by start and lengths. Supports negative indices, but replicates an off-by-one error from the original StageL implementation: the length has to be one more than seems intuitive. substring_bug_compatible("test", 0, -2) would return “tes”.