当前位置:网站首页>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
边栏推荐
- Svn actual measurement common operation record operation
- 不止于观测|阿里云可观测套件正式发布
- Vulnhub靶机:BOREDHACKERBLOG_ CLOUD AV
- Basics of reptile B1 - scrapy (learning notes of station B)
- SCM stm32f103rb, BLDC DC motor controller design, schematic diagram, source code and circuit scheme
- Thread blocking
- Oracle advanced SQL qualified query
- Graphmae - - lecture rapide des documents
- Leetcode exercise - jumping game, combination summation
- 软件工程导论——第三章——需求分析
猜你喜欢

Moonwell Artemis is now online moonbeam network

Echart 心得 (一): 有关Y轴yAxis属性

快速读论文----AD-GCL:Adversarial Graph Augmentation to Improve Graph Contrastive Learning

首次曝光 唯一全域最高等级背后的阿里云云原生安全全景图

Open cooperation and win-win future | Fuxin Kunpeng joins Jinlan organization

SVN实测常用操作-记录操作大全

From jsonpath and XPath to spl

Chapitre 2: dessiner une fenêtre

『C语言』系统日期&时间

GraphMAE----論文快速閱讀
随机推荐
Bit operation
OpenGauss数据库在 CentOS 上的实践,配置篇
宝塔面板安装php7.2安装phalcon3.3.2
Echart 心得 (一): 有关Y轴yAxis属性
Do you still have the opportunity to become a machine learning engineer without professional background?
第 2 篇:繪制一個窗口
.jar中没有主清单属性
The monthly salary of two years after graduation is 36K. It's not difficult to say
Standing at the center of the storm: how to change the engine of Tencent
Take my brother to make a real-time Leaderboard
IndexError: Target 7 is out of bounds.
Gossip: what happened to 3aC?
Oracle advanced SQL qualified query
Cloud development who is the source code of undercover applet
Svn actual measurement common operation record operation
闲谈:3AC到底发生了什么?
解决笔记本键盘禁用失败问题
[C language] system date & time
Hongmeng OS development III
First acquaintance with JUC - day01