I\'m looking for a function to convert a string of text that is in UpperCase to SentenceCase. All the examples I can find turn the text into TitleCase.
<
If your input string is not a sentence, but many sentences, this becomes a very difficult problem.
Regular expressions will prove an invaluable tool, but (1) you'll have to know them quite well to be effective, and (2) they might not be up to doing the job entirely on their own.
Consider this sentence
"Who's on 1st," Mr. Smith -- who wasn't laughing -- replied.
This sentence doesn't start with a letter, it has a digit, various punctuation, a proper name, and a . in the middle.
The complexities are enormous, and this is one sentence.
One of the most important things when using RegEx is to "know your data." If you know the breadth of types of sentences you'll be dealing with, your task will be more manageable.
In any event, you'll have to toy with your implementation until you are satisfied with your results. I suggest writing some automated tests with some sample input -- as you work on your implementation, you can run the tests regularly to see where you're getting close and where you're still missing the mark.