rustlang char array code example
Example 1: rustlang char array
let s: [char; 5] = ['h', 'e', 'l', 'l', 'o'];
Example 2: rust char array
let a = String::from("hello");
let chars: Vec<_> = a.chars().collect();
for (i,ch) in a.chars().enumerate() {
println!("{} {}", i, ch);
}