WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 remove returns from text?, Fred, March 30, 2005
     Re:remove returns from text?, Emil A Eklund, April 1, 2005

Subject: Re:remove returns from text? From: Emil A Eklund Date: April 1, 2005
The easiest way to achieve this is to use the replace method. Searching for carriage return and/or line feed, replacing them with a single space.

Like this:
str = str.replace(/\r/g, '').replace(/\n/g, ' ');

/Emil
-------------------------------------------------------

Does anyone know of a way to remove all the returns from some text (make a bunch of text a single line)?
Example:
this is a test
testing
Is converted to: this is a test testing
Thanks in advance



Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX