title: how to check if a string has a newline,then do something
body: <p>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.</p>
  
  <p>How is it possible?</p>
  
  <pre><code>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);
  </code></pre>