C#中lambda函数
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestLambda
{
class Program
{
private delegate int LambdaTest(int a, int b);
static void Main(string[] args)
{
int a = 12, b = 13;
Console.WriteLine(Test(a, b));
Console.ReadKey();
}
public static int Test(int a,int b)
{
LambdaTest lambdaTest = (_a, _b) =>
{
return _a + _b;
};
return lambdaTest(a, b);
}
}
}

浙公网安备 33010602011771号