LINQ Any()
Enumerable.Any 方法
确定序列中的任何元素是否存在或满足条件。
源码如下:
public static bool Any<TSource>(this IEnumerable<TSource> source) { if (source == null) throw Error.ArgumentNull("source"); using (IEnumerator<TSource> e = source.GetEnumerator()) { if (e.MoveNext()) return true; } return false; }