pub fn truncate_string(s: &str, max_chars: usize) -> StringExpand description
Truncate a string to max_chars, preserving word boundaries. The returned string will be at most max_chars characters long (including ellipsis). Safe for non-ASCII (UTF-8 multi-byte characters).