Check out example codes for "how to split a string by spaces rust". It will help you in understanding the concepts better.

Code Example 1

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());

Learn ReactJs, React Native from akashmittal.com