title: What is the most efficient/elegant way to filter a path list by a base path?
body: <p>What is the most efficient/elegant way to filter all paths by a base path?</p>
  
  <p>I have a path list and a base path, and I want a to get a list of paths that are children of the base path:</p>
  
  <pre><code>public IList&lt;string&gt; FilterPathList(IList&lt;string&gt; paths, string basePath)
  {
    // return a list of paths that are children of the base path
  }
  </code></pre>
  
  <p>Sample input:</p>
  
  <pre><code>c:\foo\bar\file1
  c:\foo\bar\file2
  c:\foo\bar\dir1\file11
  c:\foo\bar\dir2\file
  c:\foo\other\file1
  
  Base path -&gt; c:\foo\bar
  </code></pre>
  
  <p>Expected output:</p>
  
  <pre><code>c:\foo\bar\file1
  c:\foo\bar\file2
  c:\foo\bar\dir1\file11
  c:\foo\bar\dir2\file
  </code></pre>