How can I read the line break from a value with JavaScript and replace all the line breaks with elements?
Example:
A variable passe
It will replace all new line with break
str = str.replace(/\n/g, '')
If you want to replace all new line with single break line
str = str.replace(/\n*\n/g, '')
Read more about Regex : https://dl.icewarp.com/online_help/203030104.htm this will help you everytime.