string
The string module contains a number of useful constants and functions for manipulating strings. Most of the functionality of this module is also available in the form of string methods. The following constants are defined:
Constant | Description |
---|---|
ascii_letters | A string containing all lowercase and uppercase ASCII letters. |
ascii_lowercase | The string 'abcdefghijklmnopqrstuvwxyz'. |
ascii_uppercase | The string 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. |
digits | The string '0123456789'. |
hexdigits | The string '0123456789abcdefABCDEF'. |
letters | Concatenation of lowercase and uppercase. |
lowercase | String containing all lowercase letters specific to the current locale setting. |
octdigits | The string '01234567'. |
punctuation | String of ASCII punctuation characters. |
printable | String of printable ... |
Get Python: Essential Reference, Third Edition 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.