pub fn truncate(text: &str, max_len: usize) -> StringExpand description
Truncate text to a maximum length with ellipsis.
ยงExample
use vectorless::util::truncate;
assert_eq!(truncate("hello world", 8), "hello...");
assert_eq!(truncate("hi", 10), "hi");