Lambda 表达式是一种可用于创建"委托"或"表达式目录树"类型的"匿名函数"。Lambda 表达式对于编写 LINQ 查询表达式特别有用。
左侧指定输入参数(如果有);[2]然后在另一侧输入表达式或语句块。
x 的平方值。
delegate int del(int i); static void Main(string[] args) { del myDelegate = x => x * x; int j = myDelegate(5); //j = 25 }
Lambda 表达式是一种可用于创建"委托"或"表达式目录树"类型的"匿名函数"。Lambda 表达式对于编写 LINQ 查询表达式特别有用。
左侧指定输入参数(如果有);[2]然后在另一侧输入表达式或语句块。
x 的平方值。
delegate int del(int i); static void Main(string[] args) { del myDelegate = x => x * x; int j = myDelegate(5); //j = 25 }
相关文章: