I am looking for a very pythonic path (Python 3.x) to accomplish the following, but haven't come up with yet. If I have the following line:
string = 'this is a test string'
I can write it with:
string.title()
Result:
'This Is A Test String'
However, I want to convert if I have the following line:
string = 'Born in the USA'
Using the sample header results in:
string = 'Born in the USA'
Should the results:
'Born In The USA'
I am looking for a way to make a headline but not adjust the existing text in uppercase. Is there any way to do this?
source
share