Пример #1
0
        public static void Main(string[] args)
        {
            string parsed;
            AlphaNumbericCollector alphaNumbericCollector = new AlphaNumbericCollector();
            StringCollector        stringCollector        = new StringCollector();

            Action <string> op = StringCollector.Push;

            //void flage=Operation(op);
            //Console.WriteLine(flage);
            Console.Read();
            while (true)
            {
                Console.WriteLine("Enter the string :");
                parsed = Console.ReadLine();
                if (HasDigits(parsed))
                {
                    AlphaNumbericCollector.Push(parsed);
                }
                else
                {
                    StringCollector.Push(parsed);
                }
            }
        }
Пример #2
0
        public static void Main(string[] args)
        {
            Add    add;
            string parsed;
            AlphaNumbericCollector alphaNumbericCollector = new AlphaNumbericCollector();
            StringCollector        stringCollector        = new StringCollector();

            while (true)
            {
                Console.WriteLine("Enter the string :");
                parsed = Console.ReadLine();
                add    = alphaNumbericCollector.Push;
                add   += stringCollector.Push;
                add(parsed);
            }
        }
Пример #3
0
        public static void Main(string[] args)
        {
            string parsed;
            AlphaNumbericCollector alphaNumbericCollector = new AlphaNumbericCollector();
            StringCollector        stringCollector        = new StringCollector();

            while (true)
            {
                Console.WriteLine("Enter the string :");
                parsed = Console.ReadLine();
                if (HasDigits(parsed))
                {
                    alphaNumbericCollector.Added += alphaNumbericCollector.Push;
                    alphaNumbericCollector.Push(parsed);
                }
                else
                {
                    stringCollector.Added += stringCollector.Push;
                    stringCollector.Push(parsed);
                }
            }
        }