[Zope] String .lower, .upper, and .title in a Python Script

Ron Bickers rbickers-dated-1008884669.361564@logicetc.com
Thu, 13 Dec 2001 16:44:29 -0500


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> complaw@hal-pc.org

> In the string module, there is:  .lower(), .upper(), .capitalize(), and
> .title().

> Am I missing something?

Yeah.  In Python 2, strings have the above methods, but the string module
does not include a 'title' function.

If you're running Python 2.1 with Zope 2.4+, you can use the string method.
For example:

  >>> mystr = 'the no spin zone'
  >>> mystr.title()
  'The No Spin Zone'

No need to import the string module.
_______________________

Ron Bickers
Logic Etc, Inc.