title: LINQ get last position of special char
body: <p>i have a simple LINQ Query (linq to entities via EF)</p>
  
  <pre><code>var QueueList = (from q in context.queues                                        
                   select new { 
                               Qid = q.id, 
                               Qname = q.name.Substring(q.name.IndexOf(":") + 2) 
                   }).ToList();
  </code></pre>
  
  <p>The problem i have is the Qname. The name in the Database normally looks like this:</p>
  
  <blockquote>
    <p>Company::QueueName</p>
  </blockquote>
  
  <p>but now i have a few new Queues where the name looks like this:</p>
  
  <blockquote>
    <p>Company::Group::QueueName</p>
  </blockquote>
  
  <p>so i don't need to find the first <strong>":"</strong> in the string but the last. </p>
  
  <p>SQL doesn't support the "<strong>LastIndexOf()</strong>" method. So how do i get the last <strong>":"</strong> in the QueueName? </p>
  
  <p>I've tried it with "<strong>Reverse()</strong>" but the result was a little bit wrong (<em>gnirts</em> instead of <em>string</em>).</p>