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

go - serving up pdfs using golang -

python - Best design pattern for collection of objects -

r - Using `bbmle:mle2` with vector parameters (already works using `optim`) -