开发者

Third-party titlecase method in Python

开发者 https://www.devze.com 2022-12-29 14:59 出处:网络
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

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 l开发者_开发知识库anguages to this problem. Can anyone recommend a good implementation of this in Python?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消