Determine if string is newline in C#
Posted
by paradox
on Stack Overflow
See other posts from Stack Overflow
or by paradox
Published on 2010-04-30T07:56:22Z
Indexed on
2010/04/30
8:07 UTC
Read the original article
Hit count: 269
I am somehow unable to determine whether a string is newline or not. The string which I use is read from a file written by Ultraedit using DOS Terminators CR/LF. I assume this would equate to "\r\n" or Environment.NewLine in C#. However , when I perform a comparison like this it always seem to return false :
if(str==Environment.NewLine)
Anyone with a clue on what's going on here?
© Stack Overflow or respective owner