当前位置:网站首页>C# Lambda
C# Lambda
2022-06-24 08:04:00 【Kenight_】
Definition :Lambda The expression is an anonymous function , Is a way to simplify anonymous methods
Basic form :x => x * x ,=> It's the operator , On the left is the parameter , On the right is the expression ( Or method implementation code )
Example :
void Start()
{
// Func Is predefined delegate The last parameter of the generic is the return value
Func<int, int, string> f = (x, y) =>
{
int i = x * y;
return i.ToString();
};
print(f(2, 5));
}Parameters
If there are multiple parameters to use () , One hour can be omitted
expression
If there's only one statement , Omission {} and return , Such as x => 2 * x
Multiline statements must be added {} and return
边栏推荐
- Tuple remarks
- . No main manifest attribute in jar
- Basics of reptile B1 - scrapy (learning notes of station B)
- 『C语言』系统日期&时间
- 慕思股份在深交所上市:毛利率持续下滑,2022年一季度营销失利
- Mousse shares listed on Shenzhen Stock Exchange: gross profit margin continued to decline, and marketing failed in the first quarter of 2022
- Using kubeconfig files to organize cluster access
- 运行npm run eject报错解决方法
- Take my brother to make a real-time Leaderboard
- 解决 These dependencies were not found: * core-js/modules/es6.array.fill in xxx 之类的问题
猜你喜欢

Svn actual measurement common operation record operation

Basics of reptile B1 - scrapy (learning notes of station B)

Mousse shares listed on Shenzhen Stock Exchange: gross profit margin continued to decline, and marketing failed in the first quarter of 2022

本地备份和还原 SQL Server 数据库

Graphmae ---- quick reading of papers

Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its

Resolution error: LNK2019 unresolved external symbol

The monthly salary of two years after graduation is 36K. It's not difficult to say

Vulnhub target: boredhackerblog_ CLOUD AV

Echart's experience (I): about y axis yaxis attribute
随机推荐
没有专业背景,还有机会成为机器学习工程师吗?
Thread blocking
Domain environment importing Tencent cloud considerations
Hilbert Huang Transform
2022 PMP project management examination agile knowledge points (1)
The monthly salary of two years after graduation is 36K. It's not difficult to say
Notes on the use of date and time base
解决 These dependencies were not found: * core-js/modules/es6.array.fill in xxx 之类的问题
Oracle-高级SQL限定查询
Solution to the error of running NPM run eject
1-4metasploitable2介绍
Thread considerations
Jenkins is too old try it? Cloud native ci/cd Tekton
5-if语句(选择结构)
Auto usage example
研究生英语期末考试复习
Screenshot recommendation - snipaste
L1-019 谁先倒 (15 分)
From jsonpath and XPath to spl
本地备份和还原 SQL Server 数据库