我正在尝试找出一种简单的方法从字符串中删除 \r\n 。
例子:
文本=“这个.is.a.string。\r\n这个.is.a.string\r\n”
I tried:
text.Replace("\r\n", "")
and text.Replace("\r\n", string.Empty)
,但它不起作用。\r\n
仍然在字符串中...
结果应该是:“this.is.a.string.this.is.a.string”
这读起来更好:
text = text.Replace(System.Environment.NewLine, string.Empty);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)