let mut split = "some string 123 ffd".split("123");
for s in split {
println!("{}", s)
}
let vec = split.collect::<Vec<&str>>();
// OR
let vec: Vec<&str> = split.collect();
// if s is your String or string slice, you can split it
s.split("separator") // by separator
s.split_whitespace() // by whitespace
s.lines() // by newlines
Regex::new(r"s").unwrap().split("one two three") // by regex crate
for s in split {
println!("{}", s)
}
let vec = split.collect::<Vec<&str>>();
// OR
let vec: Vec<&str> = split.collect();