I need to capitalize the first word of each sentence from a text file and make the rest lowercase. the text file looks like this:
April 7, 2010!
here is some TEST data
to see if THE prOGRAm will
work. "what do you know!"
wiLL IT?
anything with '.' '!' '?' qualifies as the end of a sentence, but sometimes the end of a sentence isnt always a punctuation mark ie: know!"
my code so far will capitalize the first letter of every word and makes the rest lowercase. Any tips on how to capitalize only the start of a sentence ?
void reformat(string& word)
{
int wlen;
wlen = word.length();
word[0] = toupper(word[0]);
for (int i=1; i<wlen; i++)
word[i] = tolower(word[i]);
}