title: Remove leading characters in string with linq to entities
body: <p>I need to remove leading zeros from a string. I'm trying to use <code>TrimStart('0')</code> in a linq to entities query and its not supported. I found <a href="https://stackoverflow.com/questions/7936718/user-trimstart-in-entity-framework-query">this related question</a>, but that solution didn't work for me, it says that function is not supported either. Any suggestions? Thanks!</p>
  
  <p>Update: Using Sql Server and this is how I use it...</p>
  
  <pre><code>Where(c =&gt; c.StringToGet.Substring(SqlFunctions.PatIndex("%[^0]%", c.StringToGet).Value - 1) == stringToCompare)
  </code></pre>
  
  <p>Error... LINQ to Entities does not recognize the method 'System.Nullable`1[System.Int32] PatIndex(System.String, System.String)' method, and this method cannot be translated into a store expression.</p>