Lambda and javalambda expressions
Since C #3.0, you can use a new syntax to delegate the implementation code to Lambda expressions. Lambda expressions can be used whenever there is a delegate parameter type.
Lambda expressions have simpler syntax than anonymous expressions. If the called method has parameters and no parameters are required, the syntax of the anonymous method is relatively simple, because the parameter is not required.
Class Program {static void Main (string [] args) {string mid = ", middle part,"; Func <string, string> lambda = param => {param + = mid; param + = "and this was added to the string"; return param ;}; Console. writeLine (lambda ("Start of string"); Console. readKey ();}}
The required parameters are listed on the left of the Lambda operator "=>. The right side of the Lambda operator defines the implementation code of the method that grants Lambda variables.