Skip to main content

collapse_whitespace

Function collapse_whitespace 

Source
pub fn collapse_whitespace(s: &str) -> String
Expand description

Replaces newlines and other whitespace runs with single spaces and trims.

Useful when pasting multi-line titles into kasl task prompts:

PROJ-42
Fix login redirect

becomes PROJ-42 Fix login redirect.