June 14, 2011

Func samples

Some Func<> samples I found on the web
First
Func<string, string> upper = str => str.ToUpper();
Then
Func<int, int> Factorial = null;
Factorial = (n) => n <= 1 ? 1 : n * Factorial(n - 1);

No comments: