List<T>.Find() returns the first element found that matches a given criteria. So lets say we have List<int> and we use the Find method on it. What will be the returned value? If a number in the list matches the criteria it will be returned, but what if not? what does the variable zero contains after executing this code:
List<int> listOfInts = new List<int>(new int[] { 1,2,3,4,5,6,7,8,9}); int zero = listOfInts.Find( delegate(int i) { return i == 0; });
It has the value of…
This is a good one!
Every one knows that when you add a new class to a project it is private by default, but still when you compile for the first time, the compilation fails and only then you remember to add the “public” before the class name. Tired of this? Here’s what you do in [...]
We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn More