Data.String: refactor replace() and replace_once()

change to use substitute() for performance.