For example, the following code snippet prints "This was a test" three times:
The modified string is returned. (Which may mean that the original string is returned if there are no matches to be replaced.)