我在寫入製表符分隔字符串到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