I essentially want to split up a string based on the sentences, therefore (for the sake of what I'm doing), whenever there is a !, ., ?, :, ;.
How would I achieve this with multiple items to split the array with?
Thanks!
Guava's Splitter is a bit more predictable than String.split().
Iterable<String> results = Splitter.on(CharMatcher.anyOf("!.?:;"))
.trimResults() // only if you need it
.omitEmptyStrings() // only if you need it
.split(string);
and then you can use Iterables.toArray or Lists.newArrayList to wrap the output results how you like.