Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

split rust

#![feature(str_split_as_str)]
let mut split = "Mary had a little lamb".split(' ');
assert_eq!(split.as_str(), "Mary had a little lamb");
split.next();
assert_eq!(split.as_str(), "had a little lamb");
split.by_ref().for_each(drop);
assert_eq!(split.as_str(), "");
Source by doc.rust-lang.org #
 
PREVIOUS NEXT
Tagged: #split #rust
ADD COMMENT
Topic
Name
6+4 =