我有一个逐行的流阅读器(sr.ReadLine()
)。我的代码用行尾\r\n
和/或来计算行尾\n
。
StreamReader sr = new System.IO.StreamReader(sPath, enc);
while (!sr.EndOfStream)
{
// reading 1 line of datafile
string sLine = sr.ReadLine();
...
如何告诉代码(而不是通用sr.ReadLine()
)我只想计算新行\r\n
而不是完整的\n
?