title: LINQ on Directory.GetFiles with Substring in Where clause
body: <p>I have a directory that has two *.xml files that starts with "L". I tried various LINQ syntax but all returns no files. It should be simple enough but I can't wrap my head about this problem.</p>
  
  <pre><code>IEnumerable&lt;string&gt; files = Directory.EnumerateFiles(path)
      .Where(p =&gt; p.Substring(0,1) == "L");
  
  IEnumerable&lt;string&gt; files = Directory.GetFiles(path, "*.xml")
      .Where(p =&gt; (p.Substring(0,1) == "L"))
  
  IEnumerable&lt;string&gt; files = Directory.EnumerateFiles(path)
      .Where(p =&gt; p.StartsWith("L"))
  </code></pre>