In js I would do this
"abc".split("") // ["a","b","c"]
I want something simlimar in rust
let splits = String::from("abc").split("") // does not work with empty string!!!
let letters = (
splits.next().unwrap(),
splits.next().unwrap(),
splits.next().unwrap(),
) // ('a','b','c')
I want something simlimar in rust but it does not work. no error no nothing
>Solution :
You could use this:
let s = String::from("abc");
let mut chars = s.chars();
let letters = (
chars.next().unwrap(),
chars.next().unwrap(),
chars.next().unwrap(),
);