Skip to main content

trunc

Function trunc 

Source
pub fn trunc(s: &str, max: usize) -> String
Expand description

Truncates to max chars, appending .. when it does. Char-based (not byte-based) so it never splits a multi-byte codepoint.