Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

rust iterate over split

let mut split = "some string 123 ffd".split("123");
//	This gives an iterator, which you can loop over, or collect() into a vector.
for s in split {
    println!("{}", s)
}
let vec = split.collect::<Vec<&str>>();
// OR
let vec: Vec<&str> = split.collect();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rust #iterate #split
ADD COMMENT
Topic
Name
4+1 =