How can I put a newline into a TextBox, which only occurs when the string "CRLF" is received
This is what I am trying to achieve.
This is my textbox output at the moment
The line which shows CRLF?J] should be just a blank line.
This is the code I am using.
private void WriteData(string text)
{
if (text == "CRLF")
{
serial.DiscardInBuffer(); // clear "CRLF" from serial port buffer
serial.BaseStream.Flush();
OutputTextBox.AppendText("\n\n");
}
else
{
OutputTextBox.ScrollToEnd();
OutputTextBox.AppendText(text);
serial.BaseStream.Flush();
OutputTextBox.AppendText("\n");
}
}
Any and all help gratefully received.

](https://i.stack.imgur.com/aHjXv.png)](https://i.stack.imgur.com/4YF3R.png)
This is my new code, works fine now, thanks all for contributing @Selvin pointed out the right path with his comment.