본문 바로가기

닷넷관련/CSharp

List 제네릭의 FindAll 와 delegate 로 동일한값 비교하기

public void Main()
{
   
var developers = new List<string>(new []  { "Woody Allen", "Bill Gates" } );

   
var greatDeveloperFirstName = "Bill";

   
var greatDevelopers = developers.FindAll(

       
delegate (string developerName) {

           
return developerName.StartsWith(greatDeveloperFirstName);

       
});
}