Module string

Source

Structs§

StringFormat 🔒
Describes the layout of a piece of text.

Enums§

SnippetState 🔒
Result of breaking a string so it fits in a line and the state it ended in. The state informs about what to do with the snippet and how to continue the breaking process.

Constants§

MIN_STRING 🔒

Functions§

break_string 🔒
Break the input string at a boundary character around the offset max_width. A boundary character is either a punctuation or a whitespace. FIXME(issue#3281): We must follow UAX#14 algorithm instead of this.
detect_url 🔒
Returns the index to the end of the URL if the split at index of the given string includes a URL or alike. Otherwise, returns None.
graphemes_width 🔒
is_new_line 🔒
is_part_of_type 🔒
is_punctuation 🔒
is_valid_linebreak 🔒
is_whitespace 🔒
not_whitespace_except_line_feed 🔒
rewrite_string 🔒
trim_end_but_line_feed 🔒
Trims whitespaces to the right except for the line feed character.