Replace <b>
and </b>
with space " " and <br>
with \n
var a = "Welcome to xyz. You have been added as a manager by <b>Adam </b>.<br><br><b>Dashboard Link:</b> https://app.xyz.com <br><br>Use the credentials below to sign-in: <br><b>Username : </b>a@k.com<br><b>Password : </b>qwerty";
var b = a.replace("<b>|</b>"," ").replace("<br>","\n");
console.log(b);
Dashboard Link: https://app.xyz.com
Use the credentials below to sign-in:
Username : a@k.com
Password : qwerty"; var b = a.replace(/|<\/b>/g," ").replace(/
/g,"\n"); console.log(b); worked – art Jul 12 '18 at 08:56