如何把字符串里面的\\n转换成\n 等待中。。。 前台传了一个字符串过来 发现里面换行符是\\n 而不是 \n 我替换不管用 , trim()也无济于事 求教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string s = @"//a//b"; ; s = s.Replace(@"//", @"/"); str = str.Replace("\\\\n", "\\n"); str = str.Replace("\\\\n", "\\n"); string str = "sgateaf\\nadfadfadf\\n"; string strT = str.Replace("\\n", "\n");vs2010上测试没问题。 JsonObject json1 = new JsonObject(); json1.setAttribute("sourceLine", temp); string Name = sourceName.Replace("\\\\n", "\\n"); json1.setAttribute("sourceName", Name.Trim());付给JSON 前台 string Name = sourceName.Replace("\\\\n", "\n");这样试试 楼主是想看到换行的文本而不是用\n分隔的文本吧,替换成行行就行啦。正则:html=Regex.Replace(html,@"\\\\n","\n");ok! 这里应该有你的解决方案!http://topic.csdn.net/u/20100424/14/9fe2ccb0-fcb3-4e0b-89a2-a89df62b6ac8.html datadgridview导入Excel 文件复制问题 Webbrowser验证码的问题 怎样设置dataGridview的背景颜色??? 请教在C#中如何打开播放器 在线等急!!!求救 adox 问题 dataGrid的二个问题,请帮忙解决 SqlParameter的问题 计算机管理方案求各位大侠给个资料 求一本好的讲解SVN的PDF书籍。 想用C#开发一个语法高亮的代码收藏器,有什么解决方案吗(不用richTextBox) 正则如何取值?我只能取出正则的数字。取不了内容?
string s = @"//a//b"; ;
s = s.Replace(@"//", @"/");
string str = "sgateaf\\nadfadfadf\\n";
string strT = str.Replace("\\n", "\n");vs2010上测试没问题。
json1.setAttribute("sourceLine", temp);
string Name = sourceName.Replace("\\\\n", "\\n");
json1.setAttribute("sourceName", Name.Trim());
付给JSON 前台
这样试试
楼主是想看到换行的文本而不是用\n分隔的文本吧,替换成行行就行啦。正则:html=Regex.Replace(html,@"\\\\n","\n");ok!
这里应该有你的解决方案!http://topic.csdn.net/u/20100424/14/9fe2ccb0-fcb3-4e0b-89a2-a89df62b6ac8.html