I have a block of text and I want to get its lines without losing the \\r and \\n at the end. Right now, I have the following (suboptimal code):
<
If you are just going to replace the newline (\n) then do something like this:
\n
string[] lines = tbIn.Text.Split('\n') .Select(t => t + "\r\n").ToArray();
string[] lines = Regex.Split(tbIn.Text, "\r\n") .Select(t => t + "\r\n").ToArray();