Remove Return Characters From String

Remove return characters from a string. This is useful for sanitizing text which was input by a user.

textcomment = textcomment.replace(/(\r\n|\n|\r)/gm, " ");

Example:

javascript
textcomment = This\
text needs to\
have the returns removed.
";

textcomment = textcomment.replace(/(\r\n|\n|\r)/gm, " ");

Produces the result: 

textcomment == This text needs to have the returns removed.