Skip to main content

truncate_to_width

Function truncate_to_width 

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

将字符串截断到指定的显示宽度,超出部分用 “..” 替代