javascript remove line breaks from string
var stringWithLineBreaks = `
O boy
I've got
Breaks
`;
var stringWithoutLineBreaks = stringWithLineBreaks.replace(/(\r\n|\n|\r)/gm, "");//remove those line breaks
javascript remove line breaks from string
var stringWithLineBreaks = `
O boy
I've got
Breaks
`;
var stringWithoutLineBreaks = stringWithLineBreaks.replace(/(\r\n|\n|\r)/gm, "");//remove those line breaks
replace line break with html line break js
let multilineString = `My
text\r1\r\n2\n3\n\r4
is
here`;
let htmlText = multilineString.replace(/(\r\n|\n\r|\r|\n)/g, '<br>');
console.log('Multiline string: ' + multilineString);
console.log('HTML text: ' + htmlText);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us