IEnumerable_lambda1.cs
 
Code :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

//All lambda expressions use the lambda operator =>
//csc IEnumerable_lambda1.cs
namespace ConsoleApplication1
{

public class LambaExpression
{
public string words;
public LambaExpression()
{
//
// TODO: Add constructor logic here
//
}
public int SimpleFunction_Pointer1(string[] str)
{
int shortestWord = str.Min((string w) => w.Length);
return shortestWord;
}
public string SimpleFunction_Pointer2(string[] str)
{
var pointer = new[] { str };
IEnumerable<String> results = str.Where(s => s.Contains("March"));
IEnumerable<String> aWords = str.Select(s => s.ToUpper());
foreach (string s in aWords)
{
words += "\n " + s + " ";
}
foreach (string s in results)
{
words += "\n-finds--\n " + s;
}
return words;
}

class MainClass
{

public static void Main(string[] args)
{
LambaExpression le = new LambaExpression();
string[] str = { "January", "February", "March", "April" , "May"};
Console.WriteLine( "Last month word count "+le.SimpleFunction_Pointer1(str));
Console.WriteLine(le.SimpleFunction_Pointer2(str));
//
Console.ReadLine();

}
}
}
}