I am writing a program where I need to capitalize the first letter of each word in a text file. Example of information in the text file would be:
this is the first line
this is the second line
this is the third line
I have written a code that gives me back the following information:
This Is The First Line
this Is The Second Line
this Is The Third Line
I cannot figure out how to get the first word in the second and third lines capitalized.
I have used a split separator to create the array, the separator is a space. I know it is not capitaizing those letters because there is no space at the beginning of the line, but have no idea what to do to fix the problem. Can someone please help me? Thank you so much