Python string.title Function

Georg Brandl g.brandl-nospam at gmx.net
Tue Apr 11 14:39:54 EDT 2006


Allan wrote:
> Hi All -
> 
> We're developing in Python 2.4.3 and are noticing something strange.

I'm noticing strange semicolons in your code... ;)

> For example, when testing, here's what we're seeing:
> 
> x = "here's my title!";
> x = x.title();
> print x;
> Here'S My Title!
> 
> Notice the capitalization -- "Here'S".
> Any feedback on this issue is much appreciated.

str.title() isn't very sophisticated. It can't really make a difference
between an apostroph and a single quote.

If you need a better title(), I guess you'll have to write one yourself.

Georg



More information about the Python-list mailing list