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); } } }
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); } } }