javascript - Replacing all "E" characters in file to "Z" and all "Z" characters to "E" -
i want replace "e" characters in file "z" , "z" characters "e", problem once replace 1 of them, cant replace other, because characters e/z
you use function , object replacments.
var string = 'eaebzczdz'; string = string.replace(/[ez]/g, s => ({ e: 'z', z: 'e' }[s])); console.log(string);
Comments
Post a Comment