namespace
Text
String queries and building over string values — length, character access, substrings, search, prefix/suffix tests, and int conversion. Arguments are positional. Strings are byte sequences, so indices and lengths count bytes.
Text.length(s) -> intThe number of bytes in a string.Text.char_at(s, i) -> intThe byte value at an index, 0..255.Text.slice(s, a, b) -> stringA substring covering bytes [a, b).Text.starts_with(s, prefix) -> boolWhether a string begins with a given prefix.Text.ends_with(s, suffix) -> boolWhether a string ends with a given suffix.Text.contains(s, sub) -> boolWhether a substring appears anywhere in a string.Text.index_of(s, sub) -> intThe byte index of a substring, or -1 if absent.Text.equals(a, b) -> boolWhether two strings have identical bytes.Text.concat(a, b) -> stringJoin two strings into a new one.Text.to_int(s) -> intParse a leading integer from a string.Text.from_int(n) -> stringRender an integer as a string.Text.upper(s) -> stringAn uppercased copy of a string.Text.lower(s) -> stringA lowercased copy of a string.Text.trim(s) -> stringA copy with surrounding whitespace removed.Text.repeat(s, n) -> stringA string repeated n times.Text.pad_left(s, width) -> stringPad with spaces on the left to a width.Text.pad_right(s, width) -> stringPad with spaces on the right to a width.Text.split(s, sep) -> []stringSplit a string on a separator into a list.Text.join(parts, sep) -> stringJoin a list of strings with a separator.Text.replace(s, from, to) -> stringReplace every occurrence of a substring.