 <p>There's a new project, <a href="http://driftertech.somee.com/" rel="nofollow">NLib</a>, which can do this much faster:</p> <pre><code>if (input.IndexOfNotAny(new char[] { 'y', 'm', 'd', 's', 'h' }, StringComparison.OrdinalIgnoreCase) &lt; 0) { // Valid } </code></pre>