Skip to main content

truncate

Function truncate 

Source
pub fn truncate(s: &str, length: usize, tail: &str) -> String
Expand description

Truncate s to at most length display columns, appending tail if truncation occurs.

ANSI escape sequences are preserved verbatim and do not count toward the width budget. When length == 0, this function returns an empty string.