小编Slo*_*the的帖子

如何从字符串c#中删除\ r \n

我试图找出一个简单的方法从字符串中删除\ r \n.

示例:text ="this.is.a.string.\ r \n \nthis.is.a.string\r \n"

我试过了:

text.Replace("\r\n", "")text.Replace("\r\n", string.Empty)但它不工作.\r\n还在字符串中......

结果应为:"this.is.a.string.this.is.a.string"

c# string

1
推荐指数
2
解决办法
3万
查看次数

标签 统计

c# ×1

string ×1