Home > Development > C# Functional Programming and Collections

C# Functional Programming and Collections


Hi all,

Some examples of functional style development with collections…

List<int> values = new List<int> { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };
values.FindAll( x => x > 10).ForEach(x => Console.WriteLine(x));
values.Sort((x, y) => x.CompareTo(y));

Blair..

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: