Welcome to AspAdvice Sign in | Join | Help

.NET Predicates

YourGenericListOfInts.RemoveAll(new System.Predicate<int>( delegate(int val) { return (val == r.Index); }));

A predicate is a function that returns true or false and can be used for example to filter your results.. For example your .NET RemoveAll(...) function can actually do things like ...

Read more at SharpDeveloper
 

Sponsor
Published Monday, May 28, 2007 7:59 PM by salibhai
Filed under: , ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: .NET Predicates

Friday, June 08, 2007 12:06 AM by Keith Rull
I wrote a funny article about this a couple of months ago. http://www.keithrull.com/2007/03/23/Sorting+A+Generic+List+Of+Object+In+C+Using+IComparable+And+Anonymous+Delegates.aspx I think it's a pretty good intro to newbies in Anonymous delegates and predicates

Leave a Comment

(required) 
required 
(required) 
Enter the code you see below