官术网_书友最值得收藏!

Creating an expression-bodied lambda

Next, you'll define the body of the Lambda. Because this lambda will do several things, you can enclose the body of it within a set of curly braces as follows:

{
double x = xin, y = yin;
}

So, this line assigns the values from the parameters above.

Next enter the following directly below this line:

return x > y ? x : y;

So, if x is greater than y, then return x; otherwise, return y. This is an expression-bodied Lambda, and you close it at the end with a semicolon after the closed curly brace, like this };. As you can see, this Lambda expression spans multiple lines. So, you can again inline code just as with the preceding line, using the double FromStringToDouble(string s) => Convert.ToDouble(s); function.

主站蜘蛛池模板: 奉贤区| 巴彦淖尔市| 阿鲁科尔沁旗| 德兴市| 论坛| 宜黄县| 噶尔县| 安吉县| 册亨县| 鲜城| 德兴市| 都江堰市| 普兰店市| 徐汇区| 广饶县| 平乐县| 正安县| 双流县| 鹤峰县| 且末县| 循化| 徐州市| 辽宁省| 酉阳| 彝良县| 襄樊市| 连城县| 海盐县| 新营市| 洛扎县| 忻城县| 黔江区| 泰州市| 黄骅市| 丹东市| 洛隆县| 望江县| 中西区| 宿迁市| 双牌县| 富源县|