コード例 #1
0
        static void Main(string[] args)
        {
            ExtensionMethod1 ex = new ExtensionMethod1();

            ex.Demo1();
            ex.Demo2();
            ex.Demo3("veerababu");
            Console.WriteLine(Math.Sqrt(9));
            int i = 7;

            Console.WriteLine(i.prime());
            string s = "veerababu rallabandi";

            Console.WriteLine(s.reverse());



            //structure purpose
            structure st = new structure();

            st.show1();
            st.show2();
        }
コード例 #2
0
 public static void show2(this structure p)
 {
     Console.WriteLine(p);
     Console.WriteLine("I am extension method in structure");
 }