I use foreach statement really often. It is useful and more compact than for. (This way is fast in same case but in same case it is slowly for performance. But I want say not about that). List<T> class has ForEach(Action
public static void ForEach
{
if (array == null)
{
throw new ArgumentNullException("array");
}
if (action == null)
{
throw new ArgumentNullException("action");
}
for (int i = 0; i < array.Length; i++)
{
action(array[i]);
}
}
ForEach(Action
Sunday, October 12, 2008
Little deception of List.ForEach(Action action)
Labels:
for,
ForEach method,
List(T),
Net.Framework 2.0
Subscribe to:
Post Comments (Atom)


No comments:
Post a Comment