What is the best way to implement the sentence case conversion in java
For Example:
today is monday. yesterday was sunday. tuesday comes after monday
output would be
Today is monday. Yesterday was sunday. Tuesday comes after monday
My logic is:
-
Convert the whole sentence to lower case letters.
-
Check for
'.'and convert the first character to CAPITAL letters after'. '
Your logic looks fine. A bit more code:
sentence.split("[\\.?!]")would give you an array of sentences (splitting on punctuation marks