Module strings

Source
Expand description

Module for Unicode strings

Traits§

InfraStr
Methods from the WHATWG Infra Standard for strings

Functions§

collect_codepoints
Collects a sequence of Unicode codepoints given a predicate function and position to move forward.
normalize_newlines
Replaces every U+000D U+000A pair of codepoints with a single U+000A codepoint, and any remaining U+000D codepoint with a U+000A codepoint.
skip_ascii_whitespace
Moves the index of a string until it passes all ASCII whitespace.
skip_codepoints
A non-allocating version of collect_codepoints() for skipping/ignoring a series of codepoints that match a certain predicate.
strip_newlines
A string without any U+000A LINE FEED (LF) or U+000D CARIAGE RETURN (CR) codepoints.
trim_ascii_whitespace
Removes ASCII whitespace from before and after a string.
trim_collapse_ascii_whitespace
Removes ASCII whitespace from before and after a string, and collapses runs of ASCII whitespaces by replacing them with a single U+0020 SPACE codepoint.