0

What are the differences between

list.FindAll(c=>c.Contains('@')).Select(c=>new MailAddress(c))

and

list.Where(c=>c.Contains('@')).Select(c=>new MailAddress(c))

and which one should be prefered under which circumstances?

Alexander
  • 19,906
  • 19
  • 75
  • 162
  • `FindAll` is a method of `List` and was added in C# 2.0. LINQ is newer and `Where` makes more sense for general `IEnumerable`s. As a byproduct of that - FindAll isn't lazy either. – Benjamin Gruenbaum Sep 23 '14 at 07:23
  • According to MSDN `.FindAll` is a method for `List` whereas .Where is for Enumerables – Marco Sep 23 '14 at 07:23
  • Also the difference is answered here: http://stackoverflow.com/questions/25989214/list-findall-or-list-where – Thomas Sep 23 '14 at 07:24
  • Try to use the search, show what you have found and explain what exactly what you want to know that wasn't answered there. – CodeCaster Sep 23 '14 at 07:25

0 Answers0