I have a string in my Javascript application which looks like this
var myMessage = 'Thats the first line<br /> thats the second line<br /> thats the third line.';
Now I have tried to replace all <br />
with \n
and I have tried this command:
var messageFormatted = myMessage.replace('<br />', ' ');
but in messageFormatted there are still the <br />
s. My question now would be what I am doing wrong?
/g, '\n');` – Wiktor Stribiżew Aug 25 '16 at 22:15