package stringx
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
A collection of string utilities missing from OCaml's standard library
Install
dune-project
Dependency
Authors
Maintainers
Sources
v0.2.0.tar.gz
md5=d7e8dac0a07370c26439560e65f31d4b
sha512=9d1cfa248d81aa7d7573ebf62796f6307350eacec46352ebb4ffd57e38bb4516d7ce3c096f865404d27645347844d78a21e135ed9a3fb8a7d8a2bcd190de61e8
doc/CHANGELOG.html
Changelog
[v0.2.0] - 2025-06-29
- add:
trimRemoves all leading and trailing Unicode code points in the given cutset from the string. Unicode-aware. - add:
trim_funcRemoves all leading and trailing Unicode code points from the string that satisfy the given predicate function. Unicode-aware. - add:
trim_leftRemoves all leading Unicode code points in the given cutset from the string. Unicode-aware. - add:
trim_left_funcRemoves all leading Unicode code points from the string that satisfy the given predicate function. Unicode-aware. - add:
trim_rightRemoves all trailing Unicode code points in the given cutset from the string. Unicode-aware. - add:
trim_right_funcRemoves all trailing Unicode code points from the string that satisfy the given predicate function. Unicode-aware. - add:
trim_spaceRemoves all leading and trailing Unicode whitespace from the string. Unicode-aware. - add:
trim_suffixRemoves the provided trailing suffix, if present. Operates on bytes, not code points. - add:
to_lowerConverts all ASCII letters in the string to lowercase. (Full Unicode lowercasing not yet supported.) - add:
to_titleConverts all ASCII letters in the string to uppercase (title case). (Full Unicode title case not yet supported.) - add:
to_upperConverts all ASCII letters in the string to uppercase. (Full Unicode uppercasing not yet supported.) - add:
to_camel_caseConverts words separated by space, underscore, or hyphen to camelCase. The first word is lowercased, subsequent words are capitalized. Handles all-uppercase words and preserves leading/trailing separators. - add:
to_kebab_caseConverts a string to kebab-case. Uppercase ASCII letters are converted to lowercase. Word boundaries are detected at transitions and replaced with a single hyphen. Multiple separators are normalized, and leading/trailing hyphens are removed. - add:
to_pascal_caseConverts words separated by space, underscore, or hyphen to PascalCase. Each word is capitalized. Handles all-uppercase words and removes leading/trailing separators. - add:
to_snake_caseConverts a string to snake_case. Uppercase ASCII letters are converted to lowercase. Word boundaries are detected and replaced with a single underscore. Multiple separators are normalized, and leading/trailing underscores are removed.
[v0.1.0] - 2025-06-27
- add:
containsChecks if a substring is present in the string. Operates on bytes, not code points. - add:
has_prefixChecks if the string starts with the given prefix. Operates on bytes, not code points. - add:
has_suffixChecks if the string ends with the given suffix. Operates on bytes, not code points. - add:
contains_anyChecks if any Unicode code point in the given set is present in the string. Unicode-aware. - add:
count_substringCounts the number of non-overlapping occurrences of a substring in the string. Operates on bytes, not code points. - add:
equal_foldChecks if two strings are equal, ignoring ASCII case. (Full Unicode case folding not yet supported.) - add:
fieldsSplits a string by runs of Unicode whitespace, returning a list of substrings. Returns an empty list if only whitespace. - add:
fields_funcSplits a string at runs of Unicode code points where the given predicate returns true, returning a list of substrings. - add:
indexReturns the byte offset of the first occurrence of a substring in the string, or -1 if not found. - add:
repeatReturns a new string consisting of the given string repeated a specified number of times. Raises an exception if the count is negative. - add:
joinConcatenates a list of strings, inserting the given separator between each element. Returns the empty string if the list is empty.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page