Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个文本框多行用于在我的数据库中插入文本。此文本在 div 中查看,但没有换行符。
如何查看文本中的换行符?
谢谢
使用以下内容:
myText = myText.Replace(Environment.NewLine, "<br />");
用适当的 HTML 换行符替换换行符。
最好的祝愿, 法比安
把你的文字放在里面<div><pre>... text ...</pre></div>。pre标签保留换行符。
<div><pre>... text ...</pre></div>