You want to either prefix your string with @, or you can use a double slash before each n (\ n). Both of these are escaping methods \ so that it is displayed instead of being processed as part of a new line.
@"This will show verbatim\n"; "This will show verbatim\\n";
You can use this by doing a Replace in your incoming text
richTextBox1.Text = richTextBox1.Text.Replace("\n", "\n\\n"); richTextBox1.Text = richTextBox1.Text.Replace("\r\n", "\r\n\\n");
In the replacement, I left the original line so that it was there, followed by the displayed version. You can take them if you do not want it. :)
source share