What is the use of the "replace" method in a Python string?