Splitting a string
How to split a string based on specific separators?
How to split a string based on multiple characters?
fn split_stuff() {
let message = "Hello there | how are you ; doing?";
for s in message.split(|c| (c == '|') || (c == ';')) {
dbg!(s);
}
}How to split a string based on regular expressions?
Last updated