I have a function that reads a delimited file.
The separator is passed to the function with the string argument. The problem is that when I pass the delimiter "\t" , it ends up as "\\t" , and therefore Split cannot find this sequence.
How can I solve this problem?
private void ReadFromFile(string filename, string delimiter) { StreamReader sr = new StreamReader(filename, Encoding.Default); string[] firstLine = sr.ReadLine().Split(t.ToCharArray()); ....... }
source share