Answers for "rust split string into words"

0

rust split string into words

// 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
Posted by: Guest on May-31-2021

Code answers related to "rust split string into words"

Browse Popular Code Answers by Language