Answers for "rust char array"

0

rust char array

let a = String::from("hello");
let chars: Vec<_> = a.chars().collect();
for (i,ch) in a.chars().enumerate() {
  println!("{} {}", i, ch);
}
Posted by: Guest on March-09-2021
0

rustlang char array

let s: [char; 5] = ['h', 'e', 'l', 'l', 'o'];
Posted by: Guest on April-01-2021

Browse Popular Code Answers by Language