I have a String
:
"Hello world... I am here. Please respond."
and I would like to count the number of sentences within the String
. I had an idea to use a Scanner
as well as the useDelimiter
method to split
any String
into sentences.
Scanner in = new Scanner(file);
in.useDelimiter("insert here");
I'd like to create a regular expression which can go through the String
I have shown above and identify it to have two sentences. I initially tried using the delimiter:
[^?.]
It gets hung up on the ellipses.