String
This is a growable string type that is UTF-8 encoded.
let mut guess = String::new();
Splitting String
let v: Vec<&str> = "Mary had a little lamb".rsplit(' ').collect();
assert_eq!(v, ["lamb", "little", "a", "had", "Mary"]);
This is a growable string type that is UTF-8 encoded.
let mut guess = String::new();
let v: Vec<&str> = "Mary had a little lamb".rsplit(' ').collect();
assert_eq!(v, ["lamb", "little", "a", "had", "Mary"]);