Answers for "rust character 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

Browse Popular Code Answers by Language