1. Computing

Functions of Python's String Module

From , former About.com Guide

The following functions are available to operate on string and Unicode objects. They are not available as string methods.

  • capword(s): Splits the argument into words using split(), capitalize each word using capitalize(), and join the capitalized words using join(). Note that this functon replaces series of whitespace characters with a single space and removes both leading and trailing whitespace.
  • maketrans(from, to): Returns a translation table suitable for passing to [n]translate() or regex.compile(). Each character in from maps into the character at the same position in to; from and to must therefore have the same length.
Important: Don't use strings derived from lowercase and uppercase as arguments; in some locales, these don't have the same length. So, for case conversions, always use lower() and upper().
  1. About.com
  2. Computing
  3. Python
  4. Python Library
  5. Python String Module - Functions for Python Strings

©2013 About.com. All rights reserved.