public static void ForEach<T>(this IEnumerable<T> source, Action<T> action)
{
if (source == null)
throw new ArgumentNullException("source");
if (action == null)
throw new ArgumentNullException("action");
foreach (var item in source)
action(item);
}
Linq中ForEach实现
最新推荐文章于 2025-05-17 00:07:55 发布