Learn R Programming

pystr (version 2.0.0)

pystr_translate: Translate a string.

Description

Return a copy of str where all characters have been mapped through map, where map can be created with pystr_maketrans.

Usage

pystr_translate(str, map)

Arguments

str
A character vector.
map
A list of character mappings.

Value

A character vector.

References

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

See Also

pystr_maketrans

Examples

Run this code
map = pystr_maketrans("abc", "123")
pystr_translate("a blue cat", map)

Run the code above in your browser using DataLab