I have a string that has new lines in. I am wanting to convert these to HTML s, but I\'m having a hard time detecting them.
Imagine a JavaScri
Check for \n or \r or \r\n.
\n
\r
\r\n
There are several representations of newlines, see http://en.wikipedia.org/wiki/Newline#Representations