Tag: lambda expression

lambda expression with parameters

If there is a single parameter for lambda expression, just name of the parameter is sufficient as shown in below example: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication10 { class Program { static void Main(string args) { Func<string, string> oneParam = s => String.Format("change uppercase {0}", s.ToUpper()); Console.WriteLine(oneParam("test")); } }

lambda expressions

Lambda expressions allow us to reduce the code, thereby reducing the complexity of the code. Here is an example: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication10 { class Program { static void Main(string args) { Func<string, string> lambda = param => { return param + " XYZ "; }; Func<string,