PyDocs

Nav

Python Runtime Services

bytes.replace

builtins

method of bytes
  • bytes.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/bytes.replace.
See Also
No see-alsos for builtins/bytes.replace
0 Notes
No notes for bytes.replace