xor-ing strings in c#
<p>I recently started playing around with C# and I'm trying to understand why this code doesn't compile.  I get "Cannot implicitly convert type 'int' to 'char'.  An explicit conversion exits(are you missing a cast?)" on the line with error comment.</p>

<p>What I'm trying to do is simple xor operation with two strings.</p>

<p>Thanks for any inputs.</p>

<pre><code>    public string calcXor (string a, string b)
    {
        char[] charAArray = a.ToCharArray ();
        char[] charBArray = b.ToCharArray ();
        char[] result = new char[6];
        int len = 0;

        // Set length to be the length of the shorter string
        if (a.Length &gt; b.Length)
            len = b.Length - 1;
        else
            len = a.Length - 1;

        for (int i = 0; i &lt; len; i++) {
            result[i] = charAArray[i] ^ charBArray[i]; //error here
        }

        return new string (result);
    }
</code></pre>
