title: Nicer way of checking for extentions
body: <p>Hey all i have the following code:</p>
  
  <pre><code>Dim validFileTypes As String() = {".bmp", ".gif", ".png", ".jpg", ".jpeg", ".tif"}
  
  For x = 0 To NumberOfBoxes - 1
          With myTxtData(x)
              If Not Fields("customField" &amp; z).Value.Equals(DBNull.Value) Then
                  If InStr(Fields("customField" &amp; z).Value, "@") &lt;&gt; 0 Then
                      'Lower case the email address
                      .Text = StrConv(Fields("customField" &amp; z).Value, VbStrConv.Lowercase)
                  ElseIf InStr(StrConv(Fields("customField" &amp; z).Value, VbStrConv.Lowercase), ".jpg") &lt;&gt; 0 Then
                      'It contains an image!
                  Else
                      .Text = StrConv(Fields("customField" &amp; z).Value, VbStrConv.ProperCase)
                  End If
    etc etc.....
  </code></pre>
  
  <p>Instead of me checking this way:</p>
  
  <pre><code>ElseIf InStr(StrConv(Fields("customField" &amp; z).Value, VbStrConv.Lowercase), ".jpg") &lt;&gt; 0 
  OR InStr(StrConv(Fields("customField" &amp; z).Value, VbStrConv.Lowercase), ".png") &lt;&gt; 0 
  OR InStr(StrConv(Fields("customField" &amp; z).Value, VbStrConv.Lowercase), ".gif") &lt;&gt; 0 
  ...etc...
  </code></pre>
  
  <p>How can i use my defined <strong>validFileTypes</strong> to do the same but with less code?</p>