Just look at each character in the array in sequence. When you find sentence stopping punctuation, the first non-witespace character after it should be capitalized like so:
a[i] = toupper ( a[i] );
And don't forget to include
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
http://www.mcculloughdesigns.com/blog/c-sentence-case-capitalize-word/345/
However, cases where it fails...
He said, "What is your name?"
Doesn't capitalize the 'w'
It is not so clever and finding case examples such as:-
Dr.
Mr.
e.g
I
I'm
I'll
And of course doesn't handle proper nouns, such as names. It could probably be changed to get it reasonably good. And you could build a crude library of proper nouns, though it would be impossible to handleevery case.
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439