title: C#: Removing common invalid characters from a string: improve this algorithm
body: <p>Consider the requirement to strip invalid characters from a string. The characters just need to be removed and replace with blank or <code>string.Empty</code>.</p>
  
  <pre><code>char[] BAD_CHARS = new char[] { '!', '@', '#', '$', '%', '_' }; //simple example
  
  foreach (char bad in BAD_CHARS)
  {
      if (someString.Contains(bad))
        someString = someString.Replace(bad.ToString(), string.Empty);
  }
  </code></pre>
  
  <p>I'd have <strong>really liked</strong> to do this:</p>
  
  <pre><code>if (BAD_CHARS.Any(bc =&gt; someString.Contains(bc)))
      someString.Replace(bc,string.Empty); // bc is out of scope
  </code></pre>
  
  <p><strong>Question:</strong>
  Do you have any suggestions on refactoring this algoritm, or any simpler, easier to read, performant, maintainable algorithms?</p>