string — Common string operations — Python 3.14.7 documentation

docs.python.org

Tin mới

Text Processing Services

string.templatelib — Support for template string literals

Python Module Index

3.14.7 Documentation

The Python Standard Library

Text Sequence Type — str

formatted string literals

The str.format() method and the Formatter class share the same syntax for format strings (although in the case of Formatter, subclasses can define their own format string syntax). The syntax is related to that of formatt

Format string syntax¶

The str.format() method and the Formatter class share the same syntax for format strings (although in the case of Formatter, subclasses can define their own format string syntax). The syntax is related to that of formatt

object.__getitem__

The str.format() method and the Formatter class share the same syntax for format strings (although in the case of Formatter, subclasses can define their own format string syntax). The syntax is related to that of formatt

locale.setlocale()

Number. This is the same as 'd', except that it uses the current locale setting to insert the appropriate digit group separators. Note that the default locale is not the system locale. Depending on your use case, you may

Format specification mini-language¶

“Format specifications” are used within replacement fields contained within a format string to define how individual values are presented (see Format string syntax, f-strings, and t-strings). They can also be passed dire

Template strings ($-strings)¶

The feature described here was introduced in Python 2.4; a simple templating method based upon regular expressions. It predates str.format(), formatted string literals, and template string literals.