Create a character map.

Share:

Description

Create a list of character mappings usable for pystr_translate.

Usage

1

Arguments

x

A string.

y

A string.

Details

The two arguments 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.

Value

A list of character mappings for use in pystr_translate.

References

https://docs.python.org/3/library/stdtypes.html#str.maketrans

See Also

pystr_translate

Examples

1
2
map = pystr_maketrans("abc", "123")
pystr_translate("a blue cat", map)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.