Skip to main content

truncate_chars

Function truncate_chars 

Source
pub fn truncate_chars(str: &str, max: usize) -> &str
Expand description

Shortens a string to at most max characters.

Characters are Unicode scalar values, so the cut never splits one. A string already within the limit is returned whole.