Rust String To Char Array

[Solved] Rust String To Char Array | Rust - Code Explorer | yomemimo.com
Question : rust string to char array

Answered by : zwazel

let char_array = "text".chars().collect::<Vec<char>>();

Source : | Last Update : Thu, 07 Apr 22

Question : rust char array

Answered by : mackerel

let a = String::from("hello");
let chars: Vec<_> = a.chars().collect();
for (i,ch) in a.chars().enumerate() { println!("{} {}", i, ch);
}

Source : | Last Update : Tue, 16 Mar 21

Question : rustlang char array

Answered by : huldar

let s: [char; 5] = ['h', 'e', 'l', 'l', 'o'];

Source : https://stackoverflow.com/questions/38359231/how-do-i-convert-from-a-char-array-char-n-to-a-string-slice-str | Last Update : Thu, 08 Apr 21

Answers related to rust string to char array

Code Explorer Popular Question For Rust