标签: c# wpf richtextbox newline paragraph
假设我想在此文本中添加RichTextBox:
Text line 1 Text line 2 Text line 3
当Paste()到RichTextBox时,它会将\n更改为Paragraph break,但我想将\n保留为换行符。我怎么能这样做?谢谢!
Paste()
\n
答案 0 :(得分:0)
保留\r,删除\n:
\r
rtb.Selection.Text = Clipboard.GetText().Replace("\n", "");