I’m having some problem writing a tab delimited string into a txt file.
//This is the result I want:
First line. Second line. nThird line.
//But I'm getting this:
First line./tSecond line./tThird line.
Below is my code where I pass the string to be written into the txt file:
string word1 = "FirstLine.";
string word2 = "SecondLine.";
string word3 = "ThirdLine.";
string line = word1 + "/t" + word2 + "/t" + word3;
System.IO.StreamWriter file = new System.IO.StreamWriter(fileName, true);
file.WriteLine(line);
file.Close();
Use
\tfor the tab character. UsingString.Formatmay present a more readable option: