String replacement function added.