> Allen Fowler wrote: > > Hello, > > > > "He's a great guy".title() > > > > Gives me: > > > > "He'S A Great Guy" > > > > > > I expected: > > > > "He's A Great Guy" > > > > Did i miss something here? > > The docs state: > > "title( ) - Return a titlecased version of the string: words start with > uppercase characters, all remaining cased characters are lowercase." > > It depends on the definition of "word".
Yes, but in this case Python is wrong. Titlecase should, at least for Unicode strings, follow the Unicode "Default Case Algorithms", see bug http://bugs.python.org/issue6412. http://www.unicode.org/Public/5.2.0/ucd/DerivedCoreProperties-5.2.0d15.txt lists: 0027 ; Case_Ignorable # Po APOSTROPHE An as such the following would be correct: >>> "He's a great guy".title() "He's A Great Guy" I'm not subsribed to the list, CC me for answer. -Christoph Burgmer _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor