Built-in modules for strings ============================ The Python standard library contains a number of built-in modules that you can use to manage strings: .. _string-modules: +-----------------------+-------------------------------------------------------------------------------+ | Module | Description | +=======================+===============================================================================+ | :py:mod:`string` | compares with constants such as :py:data:`string.digits` or | | | :py:data:`string.whitespace` | +-----------------------+-------------------------------------------------------------------------------+ | :py:mod:`re` | searches and replaces text with regular expressions | +-----------------------+-------------------------------------------------------------------------------+ | :py:mod:`struct` | interprets bytes as packed binary data | +-----------------------+-------------------------------------------------------------------------------+ | :py:mod:`difflib` | helps to calculate deltas, find differences between strings or sequences and | | | create patches and diff files | +-----------------------+-------------------------------------------------------------------------------+ | :py:mod:`textwrap` | wraps and fills text, formats text with line breaks or spaces | +-----------------------+-------------------------------------------------------------------------------+ .. _end-string-modules: .. seealso:: * :doc:`Manipulation of strings with pandas ` * `humanize `_ .. toctree:: :titlesonly: :hidden: string re