You could make use of the str.replace(char1, char2) method for this. It replaces char1 with char2 in the string.