Lambda Expressions with Multiple Parameters or No Parameters

suggest change

Use parentheses around the expression to the left of the => operator to indicate multiple parameters.

delegate int ModifyInt(int input1, int input2);
ModifyInt multiplyTwoInts = (x,y) => x * y;

Similarly, an empty set of parentheses indicates that the function does not accept parameters.

delegate string ReturnString();
ReturnString getGreeting = () => "Hello world.";

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents