Predicate delegate in C#

I am writing few post on different type of delegates and and this post also will be part of it. In this post I am going to write about Predicate delegate which is available from C# 2.0. Following is list of post that I have written about delegates.

  1. Delegates in C#.
  2. Multicast delegates in C#.
  3. Func delegate in C#.
  4. Action delegate in C#.

Predicate delegate in C#:

As per MSDN predicate delegate is a pointer to a function that returns true or false and takes generics types as argument. It contains following signature.

Predicate<T> – where T is any generic type and this delegate will always return Boolean value. The most common use of a predicate delegate is to searching items in array or list. So let’s take a simple example. Following is code for that.

Read More

Shout it
Published Saturday, September 08, 2012 1:48 AM by Jalpesh P. Vadgama
Filed under: , , ,

Comments

# re: Predicate delegate in C#

Sunday, September 16, 2012 3:45 AM by http://www.kaneva.com/blog/569102.blog

Some truly nice stuff on this site, I enjoy it.

# re: Predicate delegate in C#

Monday, September 17, 2012 6:53 AM by Jalpesh P. Vadgama

@Keneva.com thanks