title: Filter files from directory vb.net
body: <p>Straight to the question...I have files such as word documents with extension<code>(.doc)</code> and its respective sample files starting with <code>(.sample)</code></p>
  
  <p>Now I would like to load only the word documents..</p>
  
  <p>I found the way as shown below to load the files but this loads all the files</p>
  
  <p>Can anyone say me how do I filter these files while loading them ?</p>
  
  <p>This is what I'm trying to do:</p>
  
  <pre><code>Dim files = Array.FindAll(Directory.GetFiles(mydir), Function(x) (Not x.StartsWith(".sample")))
  </code></pre>
  
  <p>This is my directory consists of files as said above:</p>
  
  <p><img src="https://i.stack.imgur.com/HayvN.png" alt="enter image description here"></p>