WideFido™

string.title() in Python

on May 21, 2008 03:18AM

John Gruber, from DaringFireball, posted a neat little title casing script he uses when publishing to his blog. (You can check out the article here )

I found it disappointing that string.title() in Python didn't title his "edge" cases properly at all. Well, I looked through his Perl script and whipped up a python version. While it isn't completely Pythonic (I tried to stay as close to his code), it is definitely usable and interesting. ;)

You can grab the source here if you would like to look through it. Any comments are appreciated.

Please Sign In to post a Comment