static void Main(string[] args) { StringDisparser myDisparser = new StringDisparser("alabala", "shukar", "gingiribin", "alkahadram"); // Demonstrate Deep Clone of IClonable implementation StringDisparser clonedDisparser = (StringDisparser)myDisparser.Clone(); clonedDisparser.stringsInput[3] = "blkahadram"; Console.WriteLine("First DIsparser : {0}\nCloned Disparser : {1}\n",myDisparser, clonedDisparser); List<StringDisparser> disparsers = new List<StringDisparser>() {myDisparser, clonedDisparser}; // Demonstrate ICOmparable implementation var orderedDisparsers = disparsers.OrderBy(dispar => dispar).ToList(); foreach (StringDisparser disparser in orderedDisparsers) { Console.WriteLine(disparser); } // Demonstrate IEnumerable implementation foreach (var ch in myDisparser) { Console.Write(ch + " "); } }
static void Main(string[] args) { var strin1 = new StringDisparser("Pesho", "Kolio", "Gosho"); var strin2 = new StringDisparser("Kolio", "Pesho", "Gosho"); Console.WriteLine(strin1.Equals(strin2)); foreach (var ch in strin2) { Console.Write(ch + " "); } }