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