Skip to main content

take_prefix_by_width

Function take_prefix_by_width 

Source
pub fn take_prefix_by_width(
    text: &str,
    max_cols: usize,
) -> (String, &str, usize)
Expand description

Take a prefix of text whose visible width is at most max_cols. Returns (prefix, suffix, prefix_width).