夜微凉、的博客

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

class Program
    {
        delegate string Get(string ss);
        delegate string Get2(int i);
        static Func<string, string> Out = s => s.ToLower();
        static Func<int, string> Out2 = s => { return s.ToString() + "这是Out2"; };
        static void Main(string[] args)
        {
            Get gt = Weituo.Lower;
            Get2 gt2 = Weituo.Upper;
            string test1 = "ABCDEFG";
            int test2 = 123456789;
            Console.WriteLine(gt(test1));
            Console.WriteLine(gt2(test2));
            Console.WriteLine(Out(test1));
            Console.WriteLine(Out2(test2));
            Console.ReadLine();
        }
    }
    public static class Weituo
    {
        public static string Lower(string str)
        {
            return "你输入的大写输出小写字母为:" + str.ToLower();
        }
        public static string Upper(int it)
        {
            return "你出入的数字输出为:" + it + "AAA";
        }
    }

posted on 2015-11-05 16:55  夜、微凉  阅读(981)  评论(0编辑  收藏  举报