Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

how to split a string by spaces rust

let mut iter = "A few words".split_whitespace();

assert_eq!(Some("A"), iter.next());
assert_eq!(Some("few"), iter.next());
assert_eq!(Some("words"), iter.next());

assert_eq!(None, iter.next());
Source by doc.rust-lang.org #
 
PREVIOUS NEXT
Tagged: #split #string #spaces #rust
ADD COMMENT
Topic
Name
2+3 =