pub fn string_sort(s: &str) -> String
Expand description

Sorts the characters of a string slice and returns them in a new String.

Worst-case complexity

$T(n) = O(n \log n)$

$M(n) = O(n)$

where $T$ is time, $M$ is additional memory, and $n$ is s.len().

Examples

use malachite_base::strings::string_sort;

assert_eq!(string_sort("Hello, world!"), " !,Hdellloorw");
assert_eq!(string_sort("Mississippi"), "Miiiippssss");