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§
Sourcefn sift(&self) -> String
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
.
Sourcefn sift_preserve_newlines(&self) -> String
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
.