D
Dylan Parry
Hi folks,
I’ve got a LINQ query that filters out items in a database that begin
with a number. It looks like this:
char[] numbers = new char[] { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9' };
var result = (from i in Items
where numbers.Contains(i.Name[0])
orderby i.Name
select i).ToList();
Now this works, but I’m sure there must be a more efficient way of doing
this. Can anyone suggest a way that I can do it in a more efficient manner?
Cheers,
I’ve got a LINQ query that filters out items in a database that begin
with a number. It looks like this:
char[] numbers = new char[] { '0', '1', '2', '3', '4', '5', '6', '7',
'8', '9' };
var result = (from i in Items
where numbers.Contains(i.Name[0])
orderby i.Name
select i).ToList();
Now this works, but I’m sure there must be a more efficient way of doing
this. Can anyone suggest a way that I can do it in a more efficient manner?
Cheers,