I am a beginner, how do I combine them:
var mystring = "my.email@computer.com";
document.write(mystring.replace(/@/, "&&"));
prints my.email&&computer.com
var mystring = "my.email@computer.com";
document.write(mystring.replace(/\./, "##"));
prints my##email@computer.com
I have two questions:
How do I make this regex (mystring.replace(/./, “##”) to after @ change the dot to ## and how can I combine those two lines into one, and final read is:my.email&&computer##com
input :
my.first.last.email@example.computer.comresult :
my.first.last.email&&example##computer##comSolution 1:
Solution 2 (configurable):