[Python-Dev] surprising bug in s.capitalize()?
Thu, 30 Nov 2000 19:38:04 +0100
> Oooh, here's something a bit more serious though:
> >>> u'aAaAaA'.capitalize()
> Something obviously Needs To Be Done. My hunch is to change
> string_capitalize, but that may be just me (and probably Barry).
Ouch. That's a bug.
Here's what the string.py module has to say about this BTW:
# Capitalize a string, e.g. "aBc dEf" -> "Abc def".
"""capitalize(s) -> string
Return a copy of the string s with only its first character
Note that .title() is very similar to the way string.capitalize()
works. unicode.title() also uses the title case information available
for Unicode characters.
Python Pages: http://www.lemburg.com/python/