title | description | author | tags |
---|---|---|---|
String to Vec<char> |
Convert a String into a vector of characters |
pyyupsk |
rust,string,vector,chars |
fn string_to_chars(s: &str) -> Vec<char> {
s.chars().collect()
}
// Usage:
let chars = string_to_chars("Hello"); // ['H', 'e', 'l', 'l', 'o']