Skip to main content

wrap_text

Function wrap_text 

Source
pub fn wrap_text(text: &str, width: usize) -> Vec<String>
Expand description

Word-wrap text to at most width display columns per line.

Breaks at the last space within the allowed width; falls back to a hard break at width characters when no space is found. Always returns at least one element.