当前位置:网站首页>C# Lambda
C# Lambda
2022-06-24 06:44:00 【Kenight_】
定义:Lambda 表达式是一个匿名函数,是简化匿名方法的一种方式
基本形式:x => x * x ,=> 是运算符,左边是参数,右边是表达式(或叫方法的实现代码)
示例:
void Start()
{
// Func 是预定义 delegate 泛型最后一个参数是返回值
Func<int, int, string> f = (x, y) =>
{
int i = x * y;
return i.ToString();
};
print(f(2, 5));
}参数
如果有多个参数需要使用 () ,一个时可以省略
表达式
如果只有一条语句,可省略 {} 和 return ,如 x => 2 * x
多行语句必须添加 {} 和 return
边栏推荐
- bjdctf_ 2020_ babystack
- Deploy L2TP in VPN (medium)
- Ultra wideband pulse positioning scheme, UWB precise positioning technology, wireless indoor positioning application
- Camera calibration (calibration purpose and principle)
- jarvisoj_ level2
- MaxCompute远程连接,上传、下载数据文件操作
- What is a CC attack? How to judge whether a website is attacked by CC? How to defend against CC attacks?
- Only two lines are displayed, and the excess part is displayed with Ellipsis
- Accessing user interface settings using systemparametersinfo
- [image fusion] image fusion based on directional discrete cosine transform and principal component analysis with matlab code
猜你喜欢
![[equalizer] bit error rate performance comparison simulation of LS equalizer, def equalizer and LMMSE equalizer](/img/45/61258aa20cd287047c028f220b7f7a.png)
[equalizer] bit error rate performance comparison simulation of LS equalizer, def equalizer and LMMSE equalizer

基因检测,如何帮助患者对抗疾病?

二分专题训练
![[WUSTCTF2020]alison_ likes_ jojo](/img/a9/dcc6f524772cd0b8781289cbaef63f.png)
[WUSTCTF2020]alison_ likes_ jojo

How to connect the Bluetooth headset to the computer and how to connect the win10 computer to the Bluetooth headset
![[WUSTCTF2020]alison_likes_jojo](/img/a9/dcc6f524772cd0b8781289cbaef63f.png)
[WUSTCTF2020]alison_likes_jojo

与(&&)逻辑或(||),动态绑定结合三目运算

When MFC uses the console, the project path cannot have spaces or Chinese, otherwise an error will be reported. Lnk1342 fails to save the backup copy of the binary file to be edited, etc
![[image fusion] multi focus and multi spectral image fusion based on pixel saliency and wavelet transform with matlab code](/img/78/5d8ad56d4ff1451590cc8676893f05.png)
[image fusion] multi focus and multi spectral image fusion based on pixel saliency and wavelet transform with matlab code

Bjdctf 2020 Bar _ Babystack
随机推荐
[Proteus] Arduino uno + ds1307+lcd1602 time display
Fine! Storage knowledge is a must for network engineers!
[image fusion] multi focus and multi spectral image fusion based on pixel saliency and wavelet transform with matlab code
Virtual machine security disaster recovery construction
利用微搭低代码实现级联选择
[WUSTCTF2020]alison_ likes_ jojo
[WordPress website] 6 Article content copy prevention
Global and Chinese market of basketball uniforms 2022-2028: Research Report on technology, participants, trends, market size and share
Deploy L2TP in VPN (medium)
[image fusion] image fusion based on directional discrete cosine transform and principal component analysis with matlab code
2.1.1 QML grammar foundation I
Muxvlan principle, Huawei MUX VLAN experimental configuration
Canal installation configuration
现货黄金有哪些眩人的小技术?
get_ started_ 3dsctf_ two thousand and sixteen
Global and Chinese market of digital fryer 2022-2028: Research Report on technology, participants, trends, market size and share
[vulhub shooting range]] ZABBIX SQL injection (cve-2016-10134) vulnerability recurrence
Lend you a pair of insight, Frida native trace
Deploy loglistener in tke container to collect logs to CLS
Several misunderstandings of VPN