I have a function which reads a delimited file.
The delimiter is passed to the function by string argument. The problem is, when I pass the "\t" delimiter, it ends up like "\\t" and therefore, Split is unable to find this sequence.
How can I resolve this issue?
private void ReadFromFile(string filename, string delimiter)
{
StreamReader sr = new StreamReader(filename, Encoding.Default);
string[] firstLine = sr.ReadLine().Split(t.ToCharArray());
.......
}
I guess you are using something like
in this case sep will hold
\\tdouble back slashuse
string sep = "\t"