Test string/replace using function replacement