User13839404 User13839404 - 4 months ago 40
C# Question

How to read text file by particular line separator character?

Reading a text file using streamreader.

using (StreamReader sr = new StreamReader(FileName, Encoding.Default))
string line = sr.ReadLine();

I want to force that line delimiter should be
. So how can i do that?

string text = sr.ReadToEnd();
string[] lines = text.Split('\r');
foreach(string s in lines)
   // Consume