Replaces  a substring with another