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

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -