Skip to main content

wrap_with_indent

Function wrap_with_indent 

Source
pub fn wrap_with_indent(text: &str, width: usize, indent: usize) -> String
Expand description

Wrap text with indentation applied to continuation lines.

The first line wraps at width. Subsequent lines are prefixed with indent characters of whitespace and wrap at width - indent to stay within the total width.

Returns the original text unchanged if width is 0.