I've got this code,which is going to reverse a text input. It doesn't capture newlines, so I want to check each time whether we encounter a newline in order to insert a newline in my result string manually.
How is it possible?
var a = textBox1.Text;
var c = Environment.NewLine;
string b = "";
foreach(var ch in a)
{
if (ch.ToString() ==c)
b += c;
else
b = ch + b;
b += "\n";
}
textBox2.Text = b;
Clipboard.SetText(b);