views:

90

answers:

2

I'm not sure about clarity of the STAR word.
I'm implementing a search method using linq-to-object in c#.
And I want to do a search with * (star) operator like most of search apps or web can do.

e.g.
If I typed "p*", results should be everything starting with "p".
And it should work for prefix star, suffix star or star in the middle.

And it would be great if the search can do with
"-" (minus/NOT) operator
or "+" (plus/OR) operator
or "AND" operator

Thanks in advance.

+5  A: 

please check regular expresions linq with regex

tsinik
+1  A: 
items.Where(x => x.StartsWith("p"));

or

from x in items where x.StartsWith("p") select x
Michael Valenty