A string (or the closest thing to that in your language)
The same string but converted to sentence case
- For this challenge, sentence case can be considered "
The first letter of each sentence is capitalized. The rest are lowercase." (i.e. proper nouns do not have to be capitalized)
- If the input does not include a period, it is treated as one sentence.
- The other 2 punctuation marks used to end a sentence in english (
!) can be considered periods
- If a letter immediately follows a punctuation mark the same rules still apply (i.e. the first letter is capitalized and all following letters are lowercased until the next punctuation mark)
Sample test cases:
"hello world." // "Hello world." "CODEGOLF IS FUN." // "Codegolf is fun." "no period" // "No period" "the ball was red. so was the balloon." // "The ball was red. So was the balloon." "I love codegolf.stackexchange.com" // "I love codegolf.Stackexchange.Com" "heLLo! hOW are yOU toDay? hOpEfulLy yOu are okay!" // "Hello! How are you today? Hopefully you are okay!"
This is code-golf, so the shortest code wins!