07. String Services¶
The modules described in this chapter provide a wide range of string manipulation operations.
In addition, Python’s built-in string classes support the sequence type
methods described in the Sequence Types — str, unicode, list, tuple, bytearray, buffer, xrange section, and also the
string-specific methods described in the String Methods section.
To output formatted strings use template strings or the %
operator
described in the String Formatting Operations section. Also, see the
re
module for string functions based on regular expressions.
- 1.
string
— Common string operations - 2.
re
— Regular expression operations - 3.
struct
— Interpret strings as packed binary data - 4.
difflib
— Helpers for computing deltas - 5.
StringIO
— Read and write strings as files - 6.
cStringIO
— Faster version ofStringIO
- 7.
textwrap
— Text wrapping and filling - 8.
codecs
— Codec registry and base classes - 9.
unicodedata
— Unicode Database - 10.
stringprep
— Internet String Preparation - 11. (deprecated)
fpformat
— Floating point conversions