StreamWriter: How to add a new line?

前端 未结 2 803
醉酒成梦
醉酒成梦 2021-01-23 23:33

I want to write a string into a file. My problem is that I cannot add new lines into the file.

using (System.IO.StreamWriter writer = new System.IO.StreamWriter(         


        
2条回答
  •  长情又很酷
    2021-01-24 00:13

    There is a specific WriteLine function for this.

    For example:

    writer.WriteLine(this.currentRealWorldObj.Title);
    writer.WriteLine();
    writer.WriteLine();
    writer.WriteLine(this.currentRealWorldObj.Description);
    

提交回复
热议问题