C# - Efficient search and replace char array in string
<p>I have e.g. </p>

<pre><code>string str ='Àpple';
string strNew="";
char[] A = {'À','Á','Â','Ä'};
char[] a = {'à','á','â','ä'};
</code></pre>

<p>I want to look through the str and see if found replace with Ascii code 'A' . So the result should be:</p>

<pre><code>strNew = 'Apple';
</code></pre>

<p>Here is my code:</p>

<pre><code>for (int i = 0; i &lt; str.Length; i++)
{ 
    if(str[i].CompareTo(A))
       strNew += 'A'
    else if(str[i].CompareTo(a)) 
       strNew +='a'
    else
       strNew += str[i];
}
</code></pre>

<p>But the compare function doesn't work, so what other function I can use?</p>
