Function crowbook_text_processing::clean::whitespaces [] [src]

pub fn whitespaces<'a, S: Into<Cow<'a, str>>>(input: S) -> Cow<'a, str>

Removes unnecessary whitespaces from a String.

Example

use crowbook_text_processing::clean;
let s = clean::whitespaces("  A  string   with   more   whitespaces  than  needed   ");
assert_eq!(&s, " A string with more whitespaces than needed ");