What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-31 03:32:26
javascript replace newline
function nl2br(str){ return str.replace(/(?:\r\n|\r|\n)/g, '<br>'); } var stringWithNewLines= `Well this is a a very broken sentance`; var stringWithBrs=nl2br(stringWithNewLines); // stringWithBrs= "Well this is a<br>a very <br... Add solution -
-
Javascript 2021-11-17 12:16:13
Delete spaces in text in javascript
str.replace(/\s+/g, '') Add solution
Best helpers
Ranking is empty