我在写入制表符分隔字符串到txt文件时出现问题。从c#.net写入制表符分隔txt文件
//This is the result I want:
First line. Second line. nThird line.
//But I'm getting this:
First line./tSecond line./tThird line.
下面是我的代码,我把这个字符串被写入到txt文件:
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();
否..使用“\ t”。 “\\ t”逃脱了斜线...... – 2012-07-26 03:26:33
@EricJ。,绝对正确。我不知道我在想什么 – Habib 2012-07-26 03:27:41