Skip to main content

normalize

Function normalize 

Source
pub fn normalize(text: &str) -> String
Expand description

Normalize whitespace in text.

  • Trims leading/trailing whitespace
  • Collapses multiple whitespace characters to single space

ยงExample

use html_cleaning::text;

assert_eq!(text::normalize("  hello   world  "), "hello world");