pub fn truncate_string(s: &str, max_len: usize) -> StringExpand description
Truncate a string to a maximum length with ellipsis.
If the string exceeds max_len, it will be truncated and “…” will be appended.
§Examples
assert_eq!(truncate_string("Hello, World!", 10), "Hello, ...");
assert_eq!(truncate_string("Short", 10), "Short");