Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 300 Bytes

string-to-vec-char.md

File metadata and controls

15 lines (13 loc) · 300 Bytes
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']