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
I don't think you understand how \n works. The resulting string still just contains a byte with value 10. This is represented in javascript source code with \n.
The code snippet you posted doesn't actually work, but if it did, the newline would be equivalent to \n, unless it's a windows-style newline, in which case it would be \r\n. (but even that the replace would still work).