module string: Common String Operations

This module defines some constants that can check character classes, and some useful string functions. See the module re for string functions based on regular expressions. The constants defined in this module are:

digits

The string '0123456789‘.

hexdigits

The string '0123456789abcdefABCDEF'.

letters

The concatenation of the strings lowercase() and uppercase() (check their entries in this list).

lowercase

A string containing all characters considered lowercase letters. On most systems this is the string 'abcdefghijklmnopqrstuvwxyz'. Don’t change its definition: the effect on the routines upper() and swapcase() is undefined.

octdigits

The string '01234567'.

uppercase

A string containing all characters considered uppercase letters. On most systems this is the string 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. Don’t change its definition: the effect on the routines lower() and swapcase() is undefined.

whitespace

A string containing all characters that are considered whitespace. On most systems this includes the characters space, tab, linefeed, return, formfeed, and vertical tab. Don’t change its definition: the effect on the routines strip() and split() is undefined.

The functions defined in this module are:

atof( s )

Converts a string to a floating-point number. The string must have the standard syntax for a floating-point literal in Python, optionally preceded by a sign (+ or -). Note that this behaves identically to the built-in function float() when passed ...

Get Python Programming On Win32 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.