怎么样吧一个字符串中的回车去掉,替换成\n,我要吧字符串传到下一个web页面,有回车的字符串有错 string text="...";char enter=(char)13;string newValue="\n";text.Replace(enter.ToString(),newValue); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 还有问题string text = "test1 test2 test3";char enter = (char)13;string newValue = "\\n";text.Replace(enter.ToString(),newValue);text 的值是 "test1\n test2\n test3"这样还是不行 string text="...";sting enter="\r\n";string newValue="\n";text.Replace(enter.ToString(),newValue); string text="...";sting enter="\\r\\n";string newValue="\\n";text.Replace(enter,newValue); my suggestion: search: htmlencodein .net msdn, maybe helpful string text="...";char enter=(char)13;char enter2 = (char)10;text.Replace(enter.ToString(),"\\n").(enter2.ToString(),""); 这样就可以了,谢谢大家string text="...";char enter=(char)13;char enter2 = (char)10;text.Replace(enter.ToString(),"\\n").(enter2.ToString(),""); 【新浪微博】能告诉我吗?我想知道C#怎么自动获取pin码。 c#上传文件至远程服务器 如何调用msi文件,并赋给其参数、得到安装进度以及信息 这样的类是如何建立的,高手们帮忙看看?? 如何把数据库连接语句让整个程序共享使用呢? ASP.NER控制flash的问题,急啊,恳请高手回答!! 水晶报表PULL模式部署在另外一台机子上,出现水晶报表登陆失败的异常。 有没有人愿意一起做PP点点通来练练C#? 当剪切板中的数据类型为object时,应该如何获得? C#中的文件操作(特急!) 如何使焦点一直在一个窗口上,不能点到另外窗口? 如何查询表中的第m-n条记录
string text = "test1
test2
test3";
char enter = (char)13;
string newValue = "\\n";
text.Replace(enter.ToString(),newValue);text 的值是
"test1\n
test2\n
test3"
这样还是不行
sting enter="\r\n";
string newValue="\n";
text.Replace(enter.ToString(),newValue);
sting enter="\\r\\n";
string newValue="\\n";
text.Replace(enter,newValue);
search: htmlencode
in .net msdn, maybe helpful
char enter=(char)13;
char enter2 = (char)10;text.Replace(enter.ToString(),"\\n").(enter2.ToString(),"");
谢谢大家
string text="...";
char enter=(char)13;
char enter2 = (char)10;text.Replace(enter.ToString(),"\\n").(enter2.ToString(),"");