📜  用符文反转字符串 - Rust 代码示例

📅  最后修改于: 2022-03-11 14:49:24.593000             🧑  作者: Mango

代码示例2
// Reverse a string with runes
fn main() {
    let r: String = "一二三四五六七八九十".chars().rev().collect();
    println!("original    {:?}", "一二三四五六七八九十");
    println!("reverse r = {:?}", "一二三四五六七八九十");    
    assert_eq!(r, "十九八七六五四三二一");
}