idiombook
7/17/2017 - 8:14 AM

[language: Rust, syntax: for-index-loop]

[language: Rust, syntax: for-index-loop]

fn main() {
    let alphabets = "abcdefghijklmnopqrstuvwxyz".chars();
    for (idx,alphabet) in alphabets.enumerate() {
        println!("idx = {} and alphabet = {}", idx, alphabet);
    }
}