且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

TextArea / Textbox显示多行的问题

更新时间:2023-12-04 13:40:10

这里的解决方案究竟是什么PBGuy试图解释你..



换行符应替换为< br>标签



str.Replace(@\\\\ n,
);







string result = Regex.Replace(input,@\\\\ nn?| \ n,
);



问候,

Praveen Nelge
Hi here the solution what exactly "PBGuy" tried to explain you..

newlines should be replaced by <br> tag

str.Replace(@"\r\n", "
");

or

string result = Regex.Replace(input, @"\r\n?|\n", "
");

Regards,
Praveen Nelge


在你的字符串之前使用'@'符号。

@亲爱的xyz \\\ \\ n \\ n \\ n希望你好。\\\\ n你的健康怎么样\\\\ n ....



希望这能解决你的问题



问候,

Sumit。
use '@' sign before ur string.
@"Dear xyz \r\n hope u r good \r\n how about ur health \r\n ...."

hope this will solve ur problem

Regards,
Sumit.