title: A faster way of doing multiple string replacements
body: <p>I need to do the following:</p>
  
  <pre><code>    static string[] pats = { "å", "Å", "æ", "Æ", "ä", "Ä", "ö", "Ö", "ø", "Ø" ,"è", "È", "à", "À", "ì", "Ì", "õ", "Õ", "ï", "Ï" };
      static string[] repl = { "a", "A", "a", "A", "a", "A", "o", "O", "o", "O", "e", "E", "a", "A", "i", "I", "o", "O", "i", "I" };
      static int i = pats.Length;
      int j;
  
       // function for the replacement(s)
       public string DoRepl(string Inp) {
        string tmp = Inp;
          for( j = 0; j &lt; i; j++ ) {
              tmp = Regex.Replace(tmp,pats[j],repl[j]);
          }
          return tmp.ToString();            
      }
      /* Main flow processes about 45000 lines of input */
  </code></pre>
  
  <p>Each line has 6 elements that go through DoRepl. Approximately 300,000 function calls. Each does 20 Regex.Replace, totalling ~6 million replaces.</p>
  
  <p>Is there any more <strong>elegant</strong> way to do this in fewer passes?</p>