Trees | Indices | Help |
|
---|
|
A collection of string operations (most are no longer used).
Warning: most of the code you see here isn't normally used nowadays. Beginning with Python 1.6, many of these functions are implemented as methods on the standard string object. They used to be implemented by a built-in module called strop, but strop is now obsolete itself.
Public module variables:
whitespace -- a string containing all characters considered whitespace lowercase -- a string containing all characters considered lowercase letters uppercase -- a string containing all characters considered uppercase letters letters -- a string containing all characters considered letters digits -- a string containing all characters considered decimal digits hexdigits -- a string containing all characters considered hexadecimal digits octdigits -- a string containing all characters considered octal digits punctuation -- a string containing all characters considered punctuation printable -- a string containing all characters considered printable
|
|||
_multimap Helper class for combining multiple mappings. |
|||
_TemplateMetaclass | |||
Template A string class for supporting $-substitutions. |
|
|||
|
|||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
list of strings |
|
||
list of strings |
|
||
list of strings |
|
||
string |
|
||
string |
|
||
int |
|
||
int |
|
||
int |
|
||
in |
|
||
int |
|
||
float |
|
||
int |
|
||
long |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
string |
|
||
|
|
|||
ascii_lowercase =
|
|||
ascii_uppercase =
|
|||
ascii_letters =
|
|||
digits =
|
|||
hexdigits =
|
|||
octdigits =
|
|||
punctuation =
|
|||
printable =
|
|||
_idmap =
|
|||
_idmapL = None
|
|||
letters =
|
Imports: _re, index_error, atoi_error, atof_error, atol_error, _float, _int, _long, maketrans, lowercase, uppercase, whitespace
|
capwords(s, [sep]) -> string Split the argument into words using split, capitalize each word using capitalize, and join the capitalized words using join. Note that this replaces runs of whitespace characters by a single space. |
Return a copy of the string s with leading and trailing whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is unicode, S will be converted to unicode before stripping.
|
Return a copy of the string s with leading whitespace removed. If chars is given and not None, remove characters in chars instead.
|
Return a copy of the string s with trailing whitespace removed. If chars is given and not None, remove characters in chars instead.
|
Return a list of the words in the string s, using sep as the delimiter string. If maxsplit is given, splits at no more than maxsplit places (resulting in at most maxsplit+1 words). If sep is not specified or is None, any whitespace string is a separator. (split and splitfields are synonymous)
|
Return a list of the words in the string s, using sep as the delimiter string. If maxsplit is given, splits at no more than maxsplit places (resulting in at most maxsplit+1 words). If sep is not specified or is None, any whitespace string is a separator. (split and splitfields are synonymous)
|
Return a list of the words in the string s, using sep as the delimiter string, starting at the end of the string and working to the front. If maxsplit is given, at most maxsplit splits are done. If sep is not specified or is None, any whitespace string is a separator.
|
Return a string composed of the words in list, with intervening occurrences of sep. The default separator is a single space. (joinfields and join are synonymous)
|
Return a string composed of the words in list, with intervening occurrences of sep. The default separator is a single space. (joinfields and join are synonymous)
|
Return the number of occurrences of substring sub in string s[start:end]. Optional arguments start and end are interpreted as in slice notation.
|
Return the lowest index in s where substring sub is found, such that sub is contained within s[start,end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.
|
Return the highest index in s where substring sub is found, such that sub is contained within s[start,end]. Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.
|
Return the integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. If base is 16, a preceding 0x or 0X is accepted.
|
Return the long integer represented by the string s in the given base, which defaults to 10. The string s must consist of one or more digits, possibly preceded by a sign. If base is 0, it is chosen from the leading characters of s, 0 for octal, 0x or 0X for hexadecimal. If base is 16, a preceding 0x or 0X is accepted. A trailing L or l is not accepted, unless base is 0.
|
Return a left-justified version of s, in a field of the specified width, padded with spaces as needed. The string is never truncated. If specified the fillchar is used instead of spaces.
|
Return a right-justified version of s, in a field of the specified width, padded with spaces as needed. The string is never truncated. If specified the fillchar is used instead of spaces.
|
Return a center version of s, in a field of the specified width. padded with spaces as needed. The string is never truncated. If specified the fillchar is used instead of spaces.
|
Pad a numeric string x with zeros on the left, to fill a field of the specified width. The string x is never truncated.
|
Return a copy of the string s, where all characters occurring in the optional argument deletions are removed, and the remaining characters have been mapped through the given translation table, which must be a string of length 256. The deletions argument is not allowed for Unicode strings.
|
replace (str, old, new[, maxsplit]) -> string Return a copy of string str with all occurrences of substring old replaced by new. If the optional argument maxsplit is given, only the first maxsplit occurrences are replaced. |
|
ascii_letters
|
printable
|
_idmap
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0 on Tue Jan 29 22:41:20 2008 | http://epydoc.sourceforge.net |