# string

A collection of string operations (most are no longer used).

Warning: most of the code you see here isn't normally used nowadays. Beginning with Python 1.6, many of these functions are implemented as methods on the standard string object. They used to be implemented by a built-in module called strop, but strop is now obsolete itself.

Public module variables:

* `whitespace` – a string containing all characters considered whitespace.
* `lowercase` – a string containing all characters considered lowercase letters.
* `uppercase` – a string containing all characters considered uppercase letters.
* `letters` – a string containing all characters considered letters.
* `digits` – a string containing all characters considered decimal digits.
* `hexdigits` – a string containing all characters considered hexadecimal digits.
* `octdigits` – a string containing all characters considered octal digits.
* `punctuation` – a string containing all characters considered punctuation.
* `printable` – a string containing all characters considered printable.

## string.maketrans(fromstr, tostr)

This static method returns a translation table usable for `str.translate()`. If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters (strings of length 1) to Unicode ordinals, strings (of arbitrary lengths) or None. Character keys will then be converted to ordinals.

If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to `None` in the result.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.verygoodsecurity.com/vault/developer-tools/larky/library-api/string.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
