Module str

Module str 

Source
Available on crate feature utils-str only.
Expand description

String Utilities

Functionsยง

truncate_string
Truncate a string to a specified length, encoding it with the given encoding. Output size may less than or equal to the specified length.
truncate_string2
Truncate a string to a specified length, encoding it with the given encoding. Output size may less than or equal to the specified length. Returns the encoded bytes and the remaining string.
truncate_string_with_enter
Truncate a string to a specified length, encoding it with the given encoding. Output size may less than or equal to the specified length. Returns the encoded bytes and the remaining string. Will try splitting at line breaks first.