Документация Python неофициальный перевод

strings.md

75 строк · 7.9 КБ · обычная страница · сырой текст · скачать

1> **Источник:** https://python-all.ru/3.1/library/strings.html2>3> «Документация Python на русском» – неофициальный перевод официальной документации Python: версии от 2.6 до 3.16, полнотекстовый поиск, английский оригинал рядом с переводом. Эта Markdown-версия страницы предназначена для работы с LLM: вставьте её в ChatGPT, Claude или Cursor.45---67# 7. Строковые службы89The modules described in this chapter provide a wide range of string manipulation operations.1011В дополнение, встроенные строковые классы Python поддерживают методы последовательностей, описанные в разделе [*Типы последовательностей – str, bytes, bytearray, list, tuple, range*](https://python-all.ru/3.1/library/stdtypes.html#typesseq), а также строковые методы, описанные в разделе [*Строковые методы*](https://python-all.ru/3.1/library/stdtypes.html#string-methods). Для форматирования строк см. раздел [*Форматирование строк*](https://python-all.ru/3.1/library/string.html#string-formatting). Также см. модуль [`re`](https://python-all.ru/3.1/library/re.html#module-re) для строковых функций, основанных на регулярных выражениях.1213- [7.1. `string` – Основные операции со строками](https://python-all.ru/3.1/library/string.html)1415  - [7.1.1. Константы строк](https://python-all.ru/3.1/library/string.html#string-constants)16  - [7.1.2. Форматирование строк](https://python-all.ru/3.1/library/string.html#string-formatting)17  - [7.1.3. Синтаксис строк форматирования](https://python-all.ru/3.1/library/string.html#format-string-syntax)1819    - [7.1.3.1. Мини-язык спецификации форматирования](https://python-all.ru/3.1/library/string.html#format-specification-mini-language)20    - [7.1.3.2. Примеры форматирования](https://python-all.ru/3.1/library/string.html#format-examples)21  - [7.1.4. Шаблонные строки](https://python-all.ru/3.1/library/string.html#template-strings)22  - [7.1.5. Вспомогательные функции](https://python-all.ru/3.1/library/string.html#helper-functions)23- [7.2. `re` – Регулярные выражения](https://python-all.ru/3.1/library/re.html)2425  - [7.2.1. Синтаксис регулярных выражений](https://python-all.ru/3.1/library/re.html#regular-expression-syntax)26  - [7.2.2. Сопоставление и поиск](https://python-all.ru/3.1/library/re.html#matching-vs-searching)27  - [7.2.3. Содержимое модуля](https://python-all.ru/3.1/library/re.html#module-contents)28  - [7.2.4. Объекты регулярных выражений](https://python-all.ru/3.1/library/re.html#regular-expression-objects)29  - [7.2.5. Объекты совпадений](https://python-all.ru/3.1/library/re.html#match-objects)30  - [7.2.6. Примеры](https://python-all.ru/3.1/library/re.html#examples)3132    - [7.2.6.1. Проверка на пару](https://python-all.ru/3.1/library/re.html#checking-for-a-pair)33    - [7.2.6.2. Имитация scanf()](https://python-all.ru/3.1/library/re.html#simulating-scanf)34    - [7.2.6.3. Избегание рекурсии](https://python-all.ru/3.1/library/re.html#avoiding-recursion)35    - [7.2.6.4. search() против match()](https://python-all.ru/3.1/library/re.html#search-vs-match)36    - [7.2.6.5. Создание телефонной книги](https://python-all.ru/3.1/library/re.html#making-a-phonebook)37    - [7.2.6.6. Обработка текста](https://python-all.ru/3.1/library/re.html#text-munging)38    - [7.2.6.7. Поиск всех наречий](https://python-all.ru/3.1/library/re.html#finding-all-adverbs)39    - [7.2.6.8. Поиск всех наречий и их позиций](https://python-all.ru/3.1/library/re.html#finding-all-adverbs-and-their-positions)40    - [7.2.6.9. Сырые строки](https://python-all.ru/3.1/library/re.html#raw-string-notation)41- [7.3. `struct` – Интерпретация байтов как упакованных двоичных данных](https://python-all.ru/3.1/library/struct.html)4243  - [7.3.1. Функции и исключения](https://python-all.ru/3.1/library/struct.html#functions-and-exceptions)44  - [7.3.2. Строки формата](https://python-all.ru/3.1/library/struct.html#format-strings)4546    - [7.3.2.1. Порядок байтов, размер и выравнивание](https://python-all.ru/3.1/library/struct.html#byte-order-size-and-alignment)47    - [7.3.2.2. Символы формата](https://python-all.ru/3.1/library/struct.html#format-characters)48    - [7.3.2.3. Примеры](https://python-all.ru/3.1/library/struct.html#examples)49  - [7.3.3. Классы](https://python-all.ru/3.1/library/struct.html#classes)50- [7.4. `difflib` – Вспомогательные функции для вычисления различий](https://python-all.ru/3.1/library/difflib.html)5152  - [7.4.1. Объекты SequenceMatcher](https://python-all.ru/3.1/library/difflib.html#sequencematcher-objects)53  - [7.4.2. Примеры SequenceMatcher](https://python-all.ru/3.1/library/difflib.html#sequencematcher-examples)54  - [7.4.3. Объекты Differ](https://python-all.ru/3.1/library/difflib.html#differ-objects)55  - [7.4.4. Пример Differ](https://python-all.ru/3.1/library/difflib.html#differ-example)56  - [7.4.5. Интерфейс командной строки для difflib](https://python-all.ru/3.1/library/difflib.html#a-command-line-interface-to-difflib)57- [7.5. `textwrap` – Перенос и заполнение текста](https://python-all.ru/3.1/library/textwrap.html)58- [7.6. `codecs` – Реестр кодеков и базовые классы](https://python-all.ru/3.1/library/codecs.html)5960  - [7.6.1. Базовые классы кодеков](https://python-all.ru/3.1/library/codecs.html#codec-base-classes)6162    - [7.6.1.1. Объекты Codec](https://python-all.ru/3.1/library/codecs.html#codec-objects)63    - [7.6.1.2. Объекты IncrementalEncoder](https://python-all.ru/3.1/library/codecs.html#incrementalencoder-objects)64    - [7.6.1.3. Объекты IncrementalDecoder](https://python-all.ru/3.1/library/codecs.html#incrementaldecoder-objects)65    - [7.6.1.4. Объекты StreamWriter](https://python-all.ru/3.1/library/codecs.html#streamwriter-objects)66    - [7.6.1.5. Объекты StreamReader](https://python-all.ru/3.1/library/codecs.html#streamreader-objects)67    - [7.6.1.6. Объекты StreamReaderWriter](https://python-all.ru/3.1/library/codecs.html#streamreaderwriter-objects)68    - [7.6.1.7. Объекты StreamRecoder](https://python-all.ru/3.1/library/codecs.html#streamrecoder-objects)69  - [7.6.2. Кодировки и Unicode](https://python-all.ru/3.1/library/codecs.html#encodings-and-unicode)70  - [7.6.3. Стандартные кодировки](https://python-all.ru/3.1/library/codecs.html#standard-encodings)71  - [7.6.4. `encodings.idna` – Интернационализированные доменные имена в приложениях](https://python-all.ru/3.1/library/codecs.html#module-encodings.idna)72  - [7.6.5. `encodings.utf_8_sig` – Кодек UTF-8 с сигнатурой BOM](https://python-all.ru/3.1/library/codecs.html#module-encodings.utf_8_sig)73- [7.7. `unicodedata` – База данных Unicode](https://python-all.ru/3.1/library/unicodedata.html)74- [7.8. `stringprep` – Подготовка строк для интернета](https://python-all.ru/3.1/library/stringprep.html)75