Expand description
String utility functions for Unicode-safe text manipulation.
Functionsยง
- truncate_
chars - Borrow a prefix of
sthat is at mostmax_charsUnicode scalar values long. - truncate_
to_ bytes - Truncate
sto at mostmax_bytesbytes, preserving UTF-8 char boundaries. - truncate_
to_ bytes_ ref - Borrow a prefix of
sthat fits withinmax_bytesbytes. - truncate_
to_ chars - Truncate a string to at most
max_charsUnicode scalar values.