Expand description
Auto-generated module
๐ค Generated with SplitRS
Functionsยง
- apply_
substitutions - Apply a substitution map to a string, replacing all occurrences of each key with its value.
- box_
title - Box-draw a title line.
- build_
line_ starts - Build a table mapping line numbers (0-indexed) to their byte start positions.
- build_
string_ env - Build the standard String environment declarations.
- byte_
pos_ to_ line_ col - Convert a
BytePosto aLineColwithin a source string. - camel_
to_ snake - Convert a
camelCaseorPascalCasestring tosnake_case. - capitalize
- Capitalize the first character of a string.
- center
- Center
swithinwidthcharacters, padding with spaces. - char_
count - Count the number of Unicode code points in a string.
- chunk_
chars - Split a string into fixed-size chunks of
ncharacters. - closest_
match - Find the closest match from
candidatestoqueryby Levenshtein distance. - components_
to_ dotted_ name - Convert a list of components back to a dotted name string.
- count_
occurrences - Count non-overlapping occurrences of
needleinhaystack. - decapitalize
- Lowercase the first character of a string.
- deduplicate_
consecutive - Remove duplicate consecutive characters from a string.
- dotted_
name_ last - Return the last component of a dotted name.
- dotted_
name_ namespace - Return the namespace prefix of a dotted name (everything before the last
.). - dotted_
name_ to_ components - Convert a dotted name string (
"Foo.bar.Baz") to a path of components. - edit_
distance - Compute the Levenshtein edit distance between two strings.
- escape_
for_ display - Escape a string for display in error messages or pretty-printed output.
- format_
list - Format a list of items with a separator.
- format_
opt - Format an optional value, using
defaultif absent. - format_
paren_ list - Format a list of items in parentheses, comma-separated.
- glob_
helper - glob_
match - Check whether a string matches a glob pattern (supports
*and?). - hr
- Create a horizontal rule of
ndashes. - in_
namespace - Check whether a name is in a given namespace.
- indent
- Indent every line of
textbynspaces. - indent_
continuation - Add
nspaces of indent to the first line andcontinuation_indentto the rest. - interleave_
char - Insert a separator between characters in a string.
- is_
all_ alpha - Return true if
scontains only ASCII letters. - is_
all_ digits - Return true if
scontains only ASCII digits. - is_
blank - Check whether
scontains only ASCII whitespace. - is_
palindrome - Check whether a string is a palindrome.
- is_
valid_ ident - Check whether
sis a valid OxiLean/Lean 4 identifier. - join
- Join
partswithsepbetween them. - lean4_
check - Format a Lean 4
#checkcommand string. - lean4_
def_ stub - Format a Lean 4
defstub. - lean4_
quote_ ident - Surround
swith backticks for Lean 4 identifier quoting. - lean4_
theorem_ stub - Format a Lean 4 theorem declaration stub.
- mangle_
name - Mangle an OxiLean name to a C/LLVM-safe identifier.
- normalize_
whitespace - Normalise all runs of whitespace in
textto a single space. - nth_
char - Return the nth Unicode code point (0-indexed), or
Noneif out of range. - pad_
left - Pad
son the left with spaces to reach at leastwidthchars. - pad_
right - Pad
son the right with spaces to reach at leastwidthchars. - register_
string_ extended_ axioms - Register all extended string axioms in the environment.
- repeat_
str - Repeat
sexactlyntimes. - replace_
first - Replace the first occurrence of
frominswithto. - reverse_
str - Reverse a string by Unicode code points.
- sentence_
count - Count sentences (splits on
.,!,?). - slugify
- Slugify a string: lowercase, replace spaces and punctuation with
-. - snake_
to_ camel - Convert a
snake_casestring tocamelCase. - snake_
to_ pascal - Convert a
snake_casestring toPascalCase. - split_
by_ chars - Split a string by a list of delimiters.
- split_
once_ or_ whole - Split
sat the first occurrence ofsep. - str_
aho_ corasick_ search - Naive multi-pattern search (Aho-Corasick approximation).
- str_
char_ to_ string - Convert char to string.
- str_
concat_ assoc_ check - Check string concatenation associativity.
- str_
contains_ refl - Check contains reflexivity: s.contains(s).
- str_
count_ alnum - Count ASCII alphanumeric chars.
- str_
count_ whitespace - Count whitespace characters.
- str_
dec_ eq_ refl - Check decidable equality: eq(s, s) = true.
- str_
dec_ eq_ sym - Check decidable equality symmetry.
- str_
edit_ dist_ sym - Check edit distance symmetry: d(a, b) = d(b, a).
- str_
edit_ dist_ triangle - Check triangle inequality for edit distance.
- str_
edit_ dist_ zero - Check edit distance identity: d(s, s) = 0.
- str_
ends_ with - Check that a string ends with suffix.
- str_
ext2_ aho_ corasick_ naive - str_
ext2_ aho_ corasick_ ty - str_
ext2_ as_ list_ char_ ty - str_
ext2_ char_ to_ string_ ty - str_
ext2_ concat_ assoc_ ty - str_
ext2_ concat_ left_ id_ ty - str_
ext2_ concat_ right_ id_ ty - str_
ext2_ contains_ refl_ ty - str_
ext2_ dec_ eq_ ty - str_
ext2_ edit_ dist_ sym_ ty - str_
ext2_ edit_ dist_ triangle_ ty - str_
ext2_ edit_ dist_ zero_ ty - str_
ext2_ ends_ with_ refl_ ty - str_
ext2_ find_ replace_ ty - str_
ext2_ format_ parse_ ty - str_
ext2_ hash_ consistent_ ty - str_
ext2_ hash_ det_ ty - str_
ext2_ join_ split_ ty - str_
ext2_ kmp_ correct_ ty - str_
ext2_ kmp_ failure - str_
ext2_ lcp_ array - str_
ext2_ lcp_ array_ ty - str_
ext2_ length_ append_ ty - str_
ext2_ length_ empty_ ty - str_
ext2_ lex_ lt_ irrefl_ ty - str_
ext2_ lex_ lt_ trans_ ty - str_
ext2_ lex_ total_ ty - str_
ext2_ prefix_ refl_ ty - str_
ext2_ prefix_ trans_ ty - str_
ext2_ rabin_ karp_ correct_ ty - str_
ext2_ replace_ id_ ty - str_
ext2_ slice_ len_ ty - str_
ext2_ split_ join_ ty - str_
ext2_ starts_ with_ refl_ ty - str_
ext2_ string_ to_ nat_ ty - str_
ext2_ substring_ ty - str_
ext2_ suffix_ array - str_
ext2_ suffix_ array_ sorted_ ty - str_
ext2_ suffix_ refl_ ty - str_
ext2_ to_ lower_ idempotent_ ty - str_
ext2_ to_ upper_ idempotent_ ty - str_
ext2_ trim_ idempotent_ ty - str_
ext2_ unicode_ valid_ ty - str_
ext2_ utf8_ roundtrip_ ty - str_
ext2_ utf16_ len_ ty - str_
find_ replace - Find and replace all occurrences.
- str_
hash_ consistent - Check hash consistency: equal strings have equal hashes.
- str_
kmp_ matches_ naive - Check KMP and naive search give same results.
- str_
kmp_ search - KMP pattern search (public wrapper).
- str_
lcp_ array - Build LCP array from suffix array.
- str_
left_ id_ check - Check left identity: โโ ++ s = s.
- str_
length_ additive - Check length additivity: len(s ++ t) = len(s) + len(t).
- str_
levenshtein - Compute Levenshtein edit distance (public wrapper).
- str_
lex_ lt - Lexicographic less-than for strings.
- str_
lex_ lt_ irrefl - Check lexicographic irreflexivity: ยฌ(s < s).
- str_
lex_ lt_ trans - Check lexicographic transitivity.
- str_
prefix_ refl - Check reflexivity of prefix: s.starts_with(s).
- str_
prefix_ trans - Check transitivity of prefix relation.
- str_
rabin_ karp_ matches_ kmp - Check Rabin-Karp and KMP give same results.
- str_
rabin_ karp_ search - Rabin-Karp pattern search (public wrapper).
- str_
replace_ id - Check replace identity: replace(p, p, s) = s.
- str_
right_ id_ check - Check right identity: s ++ โโ = s.
- str_
split_ join_ roundtrip - Split and join roundtrip: join sep (split sep s) = s.
- str_
starts_ with - Check that a string starts with prefix.
- str_
substring - Extract a substring by char index and length.
- str_
suffix_ array - Build suffix array for a string.
- str_
suffix_ array_ len - Check suffix array has correct length.
- str_
suffix_ array_ sorted - Check suffix array is sorted.
- str_
to_ lower_ idempotent - Check toLower idempotency.
- str_
to_ upper_ idempotent - Check toUpper idempotency.
- str_
trim_ idempotent - Check trim idempotency: trim(trim(s)) = trim(s).
- str_
unicode_ valid - Unicode validity: all bytes form valid UTF-8.
- str_
utf8_ roundtrip - Check UTF-8 roundtrip: decode(encode(s)) = s.
- str_
utf16_ len - Get UTF-16 code unit count.
- strip_
delimiters - Trim a balanced pair of delimiters from the start and end of
s. - strip_
line_ comment - Remove comments (starting with
--) from a line. - strip_
prefix - Check whether
sstarts withprefix, returning the remainder. - strip_
suffix - Check whether
sends withsuffix, returning the body. - template_
format - A simple string formatter that supports
{name}template substitution. - title_
case - Title-case: capitalize the first letter of each word.
- to_
lower - Convert a string to lower case.
- to_
upper - Convert a string to upper case (ASCII only for simplicity).
- truncate
- Truncate
sto at mostmax_lencharacters, appendingsuffixif cut. - word_
count - Count the number of words in a string.
- word_
wrap - Wrap
textatwidthcharacters, breaking on whitespace. - words
- Split
textinto a list of whitespace-delimited words.