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

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -