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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -