PyDocs

Nav

Python Runtime Services

bytearray.replace

  • bytearray.replace(old, new, /, count=-1)
Return a copy with all occurrences of substring old replaced by new.

  count
    Maximum number of occurrences to replace.
    -1 (the default value) means replace all occurrences.

If count is given, only the first count occurrences are replaced.
If count is not specified or -1, then all occurrences are replaced.
Changed in 3.15
  • 3.15: count is now supported as a keyword argument.
0 Examples
No examples for builtins/bytearray.replace.
See Also
No see-alsos for builtins/bytearray.replace
0 Notes
No notes for bytearray.replace