ソースコード
using System; using System.Collections.Generic; public static class IEnumerableExtensions { public static bool None<TSource>( this IEnumerable<TSource> source, Func<TSource, bool> predicate ) { foreach ( var n in source ) { if ( predicate( n ) ) { return false; } } return true; } }
使い方
var list = new []{ 1, 2, 3, 4, 5 }; Debug.Log( list.None( c => c == 10 ) ); // True