匿名方法

class Program
    {
        static void Main(string[] args)
        {
            //匿名方法
            //第一个参数是返回值类型,后面的都是输入参数
            //表达式“=”左面是形参,“>”右面是函数体
            Func<string, string, string> MyFunc = (s, s1) =>
            {
                s = s + s1;
                return s;
            };

            string ss = MyFunc("大家","您好");

            Console.WriteLine(ss);
            Console.ReadLine();
        }
    }
原文地址:https://www.cnblogs.com/dlexia/p/4653427.html