normalize_whitespace

Function normalize_whitespace 

Source
pub fn normalize_whitespace(text: &str, collapse_multiple: bool) -> String
Expand description

Normalize whitespace characters for consistent processing

Converts various Unicode whitespace characters to standard spaces and optionally collapses multiple consecutive whitespace characters.

§Arguments

  • text - Input text with potentially mixed whitespace
  • collapse_multiple - Whether to collapse multiple spaces into one

§Returns

String with normalized whitespace