I'm looking for some very clever and fast way of transforming every first character of a word in a string with the upper case.
ac milan > Ac Milan
paris saint germain > Paris Saint Germain
Use the title
method of str
:
'ac milan'.title()
Is this what you're looking for?
>>> "how now brown cow".title()
'How Now Brown Cow'
精彩评论