Home
»
Good to know
» Replace all line breaks in a string with <br /> tags?
Replace all line breaks in a string with <br /> tags?
Posted no: 02-04-2016
var str = str.replace(/(?:\r\n|\r|\n)/g, '<br />');