how to replace character from a string