Skip to main content

truncate_text

Function truncate_text 

Source
pub fn truncate_text(text: &str, max_graphemes: usize) -> String
Expand description

Truncate text to max_graphemes graphemes. Using graphemes to avoid accidentally truncating in the middle of a multi-codepoint character.