s.split("separator")
s.split_whitespace()
s.lines()
split
can be used with a closure to fulfill this use case.s = "Hello there " s = " how are you " s = " doing?"
regex
crate for splitting based on regular expressions.collect
method."hello there; how| are|you, chathura"
based on multiple characters and taking into account multiple spaces is not simple without using regular expressions.