How can I force StringReader.ReadLine() (or alternative stream) to use \n instead of \r\n?
views:
41answers:
2
+2
A:
From the MSDN documentation on StringReader.ReadLine:
A line is defined as a sequence of characters followed by a line feed ("\n"), a carriage return ("\r"), or a carriage return immediately followed by a line feed ("\r\n"). The resulting string does not contain the terminating carriage return and/or line feed. The returned value is null if the end of the underlying string has been reached.
So, it will read lines terminated with \n, \r or \r\n by default. You do not need to override anything.
Oded
2010-06-23 09:52:14
A:
The StringReader.ReadLine doesn't use only "\r\n" as line delimiter, it accepts either "\r\n", "\r" or "\n".
Guffa
2010-06-23 09:54:17