Any way to find out which line break char(s) to use in Javascript?

Posted by Irro on Stack Overflow See other posts from Stack Overflow or by Irro
Published on 2010-06-11T18:49:47Z Indexed on 2010/06/11 18:52 UTC
Read the original article Hit count: 184

Filed under:
|
|

I'm trying to parse some text into a textarea control and at the same time replace all
with ordinary line break chars.

I have been able to do it in windows by replacing
with CR (it didn't work with CRLF strangely enough, it gave me linebreak + empty space) but I'm afraid that this code won't work in Unix/Mac because they use LF for line break.

Is there any way to use the system default line break char in javascript? Something similar to Environment.NewLine in .Net

(I wasn't able to write backslash in this editor but I use /r for CR and /n for LF, replace / with backslash)

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html