Asynchronous alternative to "string".replace