bytes.replace()

bytes.replace(old, new[, count]) bytearray.replace(old, new[, count])

Return a copy of the sequence with all occurrences of subsequence old replaced by new. If the optional argument count is given, only the first count occurrences are replaced.

The subsequence to search for and its replacement may be any bytes-like object.

Note

The bytearray version of this method does not operate in place - it always produces a new object, even if no changes were made.

doc_python
2016-10-07 17:28:05
Comments
Leave a Comment

Please login to continue.