WhitespaceSifter

Trait WhitespaceSifter 

Source
pub trait WhitespaceSifter: AsRef<str> {
    // Provided methods
    fn sift(&self) -> String { ... }
    fn sift_preserve_newlines(&self) -> String { ... }
}
Expand description

A trait containing all string whitespace-sifting functions.

Provided Methods§

Source

fn sift(&self) -> String

This removes duplicate whitespaces from a string implementing AsRef<str>. This follows the is_ascii_whitespace implementation. This treats carriage-returns as just one char in the string.

Source

fn sift_preserve_newlines(&self) -> String

This removes duplicate whitespaces from a string implementing AsRef<str>. This follows the is_ascii_whitespace implementation. This preserves deduplicated newlines. This treats carriage-returns as just one char in the string.

Implementors§