c# - how do i return a count of match items -
i have sorted generic list. return first 10 match condition.
sort of method below first 10 items
mysortedlist.findall(delegate(myclass tmp){ return tmp.id == 123;});
something following:
int count = 0; mysortedlist.findall(delegate(myclass tmp){ return (tmp.id == 123 && ++count <= 10);});
Comments
Post a Comment