我在将制表符分隔的字符串写入 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();