匿名函数2
来源:互联网 发布:杭州市网络作家协会 编辑:程序博客网 时间:2024/06/06 11:47
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 匿名函数2{ //public delegate void MyDel(); public delegate string MyDelTwo(string msg); public delegate int MyDel(int n1,int n2,int n3); class Program { static void Main(string[] args) { #region 冗余代码 //List<int> list = new List<int>() { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 12, 13, 14 }; //IEnumerable<int> ies = list.Where(x => x > 5); //foreach(var item in ies) //{ // Console.WriteLine(item); //} //Console.ReadKey(); #endregion #region 拉姆达表达式 //MyDel mdl = ()=> { Console.WriteLine("哈哈哈"); }; //mdl(); //Console.ReadKey(); #endregion #region 带参数的拉姆达表达式 //MyDelTwo mdt = x => x + ""; //string msg = mdt("小陆"); //Console.WriteLine(msg); //Console.ReadKey(); #endregion T1((x, y, z) => x + y + z); Console.ReadKey(); } public static void T1(MyDel add) { int result = add(10, 20, 30); Console.WriteLine(result); } }}
0 0
- 匿名函数2
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- 匿名函数
- VHDX安装双系统
- table可编辑表格写法(简单)
- C# ABP 允许跨域请求
- QA价值体现
- MarkDown MarkDown语法介绍
- 匿名函数2
- google git-repo 命令参考(Repo command reference)
- IOS coredata基础
- Unity发布WebGl逐行读取本地文本文件
- volatile变量小结
- React Native学习六- ActivityIndicator
- linux查找目录下的所有文件中是否含有某个字符串
- Tensorflow深度学习入门——TF自带的数据文件读取及下载
- I love sneakers!(分组背包变形)