简体   繁体   English

StreamWriter结束行使用Lf而不是CrLf

[英]StreamWriter end line with Lf rather than CrLf

I'm using StreamWriter to output a text file, but I would like to end my WriteLine with Lf rather than the default CrLf. 我正在使用StreamWriter输出文本文件,但我想用Lf结束我的WriteLine而不是默认的CrLf。 Is there an easy way to do this using a parameter built into StreamWriter? 有没有一种简单的方法可以使用StreamWriter中内置的参数来完成此操作?

I feel like quite a moron right now, but I'll leave the question up here just for laughs. 我现在感觉自己像个白痴,但我会把问题留在这里只是为了笑。 It's been a long day... 这是漫长的一天......

它附带了一个NewLine属性。

只需调用.write并在结尾处添加换行符?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM