Answers for "convert string to char array rust"

0

rust char to string

fn main() {
    let string = 'c'.to_string();
}
Posted by: Guest on April-06-2021
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

Code answers related to "convert string to char array rust"

Browse Popular Code Answers by Language