PyDocs

Nav

Python Runtime Services

bytearray.translate

  • bytearray.translate(table, /, delete=b'')
Return a copy with each character mapped by the given translation table.

  table
    Translation table, which must be a bytes object of length 256.

All characters occurring in the optional argument delete are
removed.  The remaining characters are mapped through the given
translation table.
Changed in 3.6
  • 3.6: delete is now supported as a keyword argument.
1 Example
>>> b'read this short text'.translate(None, b'aeiou')
b'rd ths shrt txt'
from the Python docs
See Also
No see-alsos for builtins/bytearray.translate
0 Notes
No notes for bytearray.translate