Noob question, I need to split a string by many separators, and I want to delete all whitespaces, but Guava Charmatcher is removing linebreaks too (and linebreak is one of the separators):
Iterable<String> splittedRuts = Splitter.onPattern("\r?\n|,|/|;")
As long as you're ok with only removing the normal space character, you can just use
Also, you may want to look at
Splitter.trimResults() if your reason for wanting to strip whitespace is that you end up with leading or trailing whitespace when splitting.