Function malachite_base::strings::string_unique
source · pub fn string_unique(s: &str) -> String
Expand description
Takes a string slice’s unique characters and returns them in a new String
.
The unique characters are output in order of appearance.
§Worst-case complexity
$T(n) = O(n)$
$M(n) = O(n)$
where $T$ is time, $M$ is additional memory, and $n$ is s.len()
.
§Examples
use malachite_base::strings::string_unique;
assert_eq!(string_unique("Hello, world!"), "Helo, wrd!");
assert_eq!(string_unique("Mississippi"), "Misp");