0

When i am extratcing the text , it is coming as

Orange juice fresh wth topping and crustig provided,and it will be an extracost,.
            juice available for sugar free person also

How to make the text come into a single line (remove all new lines )

This is my fiddle

http://jsfiddle.net/cod7ceho/32/

1 Answers1

0

You can use replace method:

str = str.replace(/(?:\r\n|\r|\n)/g, '<br />');

OR

str = str.replace(/(?:\r\n|\r|\n)/g, ' ');
Ashkan Arefi
  • 665
  • 4
  • 7