Removing Newlines

Ken Dickinson's Avatar

Ken Dickinson

Jan 04, 2013 @ 04:41 PM

What is the best way to remove newlines from a variable. For example, I have a node containing xhtml. TinyMCE will automatically add newlines to the value. I've tried various replace functions but I still get the new line (what I want is to put the html code from TinyMCE into an ASP.NET variable). replace('\n', ' ') works strangely. In this example, it will add the space, but the newline remains.

  1. 1 Posted by Eric L. Epps on Jan 04, 2013 @ 06:06 PM

    Eric L. Epps's Avatar

    Perhaps it's using Windows-style newlines? (\r\n)

  2. 2 Posted by Ken Dickinson on Jan 04, 2013 @ 07:58 PM

    Ken Dickinson's Avatar

    That was indeed the solution. Thank you!

  3. Tim closed this discussion on Jan 04, 2013 @ 08:26 PM.

Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac