aboutsummaryrefslogtreecommitdiff
path: root/rust/reverse-string/src/lib.rs
blob: f488a6e9f6cc71529092009da8b89487c7110a66 (plain) (blame)
1
2
3
4
5
use unicode_segmentation::UnicodeSegmentation;

pub fn reverse(input: &str) -> String {
    UnicodeSegmentation::graphemes(input, true).rev().collect()
}