• C# lamda表达式


    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace lamda表达式
    {
        public delegate void DeleOne();
        public delegate void DeleTwo(string name);
        public delegate string DeleThree(string name);
        class Program
        {
            static void Main(string[] args)
            {
                //1 匿名函数
                //DeleOne dele1 = delegate(){};
                //DeleTwo dele2 = delegate(string name) { };
                //DeleThree dele3 = delegate(string name) { return name;   };
    
                //lamda表达式中的委托
                DeleOne dele1 = () => { };
                DeleTwo dele2 = (string name) => { };
                DeleThree dele3 = (string name) => { return name; };
    
                List<int> list = new List<int>() { 1, 2, 3, 6, 3, 5, 7 };
                //表示n所满足的条件
                list.RemoveAll(n => n > 4);
                foreach(var item in list)
                {
                    Console.WriteLine(item);
                }
    
            }
        }
    }
  • 相关阅读:
    【Coreforces 1253E】
    计数专题乱做
    PKUWC2020乱做
    多项式板子
    notepad
    2021.4.9
    2021.4.8
    2021.3.31
    2021.3.26
    2021.3.25
  • 原文地址:https://www.cnblogs.com/my-cat/p/7831125.html
Copyright © 2020-2023  润新知