views:

84

answers:

1

The standard string title() method in Python is pretty naive and doesn't correctly handle converting even fairly simple words and phrases to title case (hyphenated words, phrases with quotes, phrases with prepositions, etc.).

In Googling around, I found a few solutions in different languages to this problem. Can anyone recommend a good implementation of this in Python?

+2  A: 

Found this via Google: http://muffinresearch.co.uk/archives/2008/05/27/titlecasepy-titlecase-in-python/

Will McCutchen
Looks pretty good to me. I also found some additional comments on that module:http://www.leancrew.com/all-this/2009/08/capitalization-and-titlecasepy/
jrdioko