Skip to main content

slice_with_width

Function slice_with_width 

Source
pub fn slice_with_width(
    line: &str,
    start_col: usize,
    length: usize,
) -> (String, usize)
Expand description

Slice text by visible columns, returning both the extracted text and its width. Like slice_by_column but also returns the actual visible width of the result. Matches pi’s sliceWithWidth.