Skip to main content

wrap_text

Function wrap_text 

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

Word-wrap plain text into rows no wider than width.

Existing \n line breaks are preserved. Overlong words are hard-split.