title: Conditions depending on the value of an array
body: <p>Let's suppose i have a dynamic array like this:</p>
  
  <pre><code>string[] documentsContentTypes = {".pdf",".docx",".xls"};
  </code></pre>
  
  <p>And now i want to use it to add conditions to an if statement.</p>
  
  <p>In the end, the if will be something like this:</p>
  
  <pre><code>if(Path.GetExtension(postedFile.FileName).ToLower() != ".pdf" &amp;&amp; Path.GetExtension(postedFile.FileName).ToLower() != ".docx" &amp;&amp; Path.GetExtension(postedFile.FileName).ToLower() != ".xls")
  return false;
  </code></pre>
  
  <p>I want to make sure that if the extension it's neither of these the function will return false.</p>
  
  <p>how can i achive this? Thanks</p>