ellipsize_middle

Function ellipsize_middle 

Source
pub fn ellipsize_middle(
    s: &str,
    threshold: usize,
    head: usize,
    tail: usize,
) -> String
Expand description

Ellipsize a string in the middle when it exceeds the threshold.

Produces: first head chars, a Unicode ellipsis ‘…’, then last tail chars. Returns the original string if it does not exceed the threshold, or if the requested head/tail slice would not shorten it.