Rust:chars - halmk/Library GitHub Wiki

chars()

Overview

charsι–’ζ•°γ―ζ–‡ε­—εˆ—γ‚’γͺめるむテレータ(Iterator<Item = char>)γ‚’η”Ÿζˆγ™γ‚‹

Code

fn main() {
    let s = String::from("HogeFoo");
    println!("{:?}", s.chars()); // Chars(['H','o','g','e','F','o','o'])
    for ch in s.chars() {
        print!("{}", ch);        // HogeFoo
    }
}

Detail