title: How to XOR two strings in C#?
body: <p>I am making a programme to encrypt a message using a vegnier cypher.
  But i am not sure what is wrong with it as when I xor the two variables it just outputs a question mark in a box any help will be appreciated.</p>
  
  <pre><code>    static string xor(string plaintext, string pad)
      {
          string cyphertext = "";
          for (int i = 0; i &lt; (plaintext.Length); i++)
          {
              char p1 = Convert.ToChar(plaintext.Substring(i, 1));
              char c1 = Convert.ToChar(pad.Substring(i, 1));
              char ct1 = (char)(p1 ^ c1);
              cyphertext = cyphertext + (Convert.ToString(ct1));
  
          }
          return cyphertext;
      }
  </code></pre>