streamWriter.WriteLine

streamWriter.WriteLine写入文件有回车行

using (System.IO.StreamWriter streamWriter = new System.IO.StreamWriter(@"D:\123.txt", false, System.Text.Encoding.Default))

{

streamWriter.Write(str.Replace("\r\n", "").Trim());

streamWriter.Close();

streamWriter.Dispose();

}

相关推荐
景天科技苑37 分钟前
【Rust通用集合类型】Rust向量Vector、String、HashMap原理解析与应用实战
开发语言·后端·rust·vector·hashmap·string·rust通用集合类型
阿沁QWQ1 小时前
友元函数和友元类
开发语言·c++
小黑随笔2 小时前
【Golang玩转本地大模型实战(一):ollma部署模型及流式调用】
开发语言·后端·golang
江沉晚呤时3 小时前
Redis缓存穿透、缓存击穿与缓存雪崩:如何在.NET Core中解决
java·开发语言·后端·算法·spring·排序算法
achene_ql3 小时前
缓存置换:用c++实现最近最少使用(LRU)算法
开发语言·c++·算法·缓存
高效匠人3 小时前
Python10天冲刺-设计模型之策略模式
开发语言·人工智能·python·策略模式
黄雪超4 小时前
JVM——JVM 是如何执行方法调用的?
java·开发语言·jvm
风暴之零4 小时前
文本中地理位置提取方法—正则和NLP模型
开发语言·python
Dxy12393102164 小时前
python合并word中的run
开发语言·python·word
why1514 小时前
百度网盘golang实习面经
开发语言·后端·golang