public static void Main()
        {
            StringDisperser stringDisperser = new StringDisperser("gosho", "pesho", "tanio");
            StringDisperser st = new StringDisperser("gosho", "pesha", "tanio");

            Console.WriteLine(st.ToString());
        }
        static void Main()
        {
            StringDisperser stringDisperser = new StringDisperser("gosho", "pesho", "tanio");

            StringDisperser stringDisperser2 = new StringDisperser("joro", "moro", "pepi");

            Console.WriteLine(stringDisperser2 == stringDisperser);
            Console.WriteLine(stringDisperser2 != stringDisperser);
            Console.WriteLine(stringDisperser.Equals(stringDisperser2));
            Console.WriteLine(stringDisperser);

            var stringDisperser3 = stringDisperser.Clone() as StringDisperser;
            stringDisperser3.Strings.Add("Mlechko");
            Console.WriteLine(stringDisperser3);
            Console.WriteLine(stringDisperser);

            Console.WriteLine();
            var stringDespersers = new List<StringDisperser> { stringDisperser, stringDisperser2, stringDisperser3 };
            stringDespersers.Sort();
            Console.WriteLine(string.Join("\n", stringDespersers));

            Console.WriteLine();
            foreach (var ch in stringDisperser)
            {
                Console.Write(ch + " ");
            }
        }
    static void Main()
    {
        var stringDispersers = new StringDisperser[]
            {
                new StringDisperser("gamma", "beta", "gamma", "delta"),
                new StringDisperser("beta", "alpha", "gamma", "delta"),
                new StringDisperser("alpha", "gamma", "beta", "delta"),
            };

        Array.Sort(stringDispersers);

        foreach (var stringDisperser in stringDispersers)
        {
            Console.WriteLine(stringDisperser);
        }

        Console.WriteLine();

        Console.WriteLine(stringDispersers[0].Equals(stringDispersers[1]));
        Console.WriteLine(stringDispersers[0].Equals(stringDispersers[0]));
        Console.WriteLine();

        foreach (var stringDisperser in stringDispersers)
        {
            foreach (var ch in stringDisperser)
            {
                Console.Write(ch + " ");
            }

            Console.WriteLine();
        }
    }
        static void Main(string[] args)
        {
            StringDisperser stringDisperser = new StringDisperser("pesho");
            StringDisperser stringDisperser2 = new StringDisperser("pesho");

            // foreach
            foreach (var ch in stringDisperser)
            {
                Console.Write(ch + " ");
            }

            Console.WriteLine();

            // check if equal
            Console.WriteLine(stringDisperser.Equals(stringDisperser2)); // true

            // check if equal with opearator != & ==
            Console.WriteLine(stringDisperser != stringDisperser2); // true
            Console.WriteLine(stringDisperser == stringDisperser2); // false

            // clone and check if reference is the same
            var stringDisperser3 = (StringDisperser)stringDisperser.Clone();
            Console.WriteLine(ReferenceEquals(stringDisperser, stringDisperser3)); // false

            // compare two StringDispersers
            var stringDisperser4 = new StringDisperser("pesho", "gosho", "tanio");
            Console.WriteLine(stringDisperser.CompareTo(stringDisperser4));
        }
Beispiel #5
0
 static void Main(string[] args)
 {
     StringDisperser stringDisperser = new StringDisperser("Proba", "Test", "678");
     foreach (var symbol in stringDisperser)
     {
         Console.Write(symbol+" ");
     }
 }
Beispiel #6
0
 static void Main(string[] args)
 {
     StringDisperser str = new StringDisperser("aaaaaa", "bbbbbbbb");
     foreach (var symb in str)
     {
         Console.WriteLine( symb);
     }
 }
 public static void Main()
 {
     StringDisperser stringDisperser = new StringDisperser("gosho", "pesho", "tanio");
     foreach (var ch in stringDisperser)
     {
         Console.Write(ch + " ");
     }
 }
Beispiel #8
0
 private static void Main(string[] args)
 {
     var stringDisperser = new StringDisperser("gosho", "pesho", "tanio");
     foreach (var ch in stringDisperser)
     {
         Console.Write(ch + " ");
     }
 }
Beispiel #9
0
 static void Main(string[] args)
 {
     StringDisperser disprerser = new StringDisperser(new string[] {"gosho", "pesho","ivan" });
     foreach (var character in disprerser)
     {
         Console.Write(character + " ");
     }
     Console.WriteLine();
 }
Beispiel #10
0
    static void Main(string[] args)
    {
        StringDisperser stringDisperser = new StringDisperser("gosho", "pesho", "tanio");

        foreach (var ch in stringDisperser)
        {
            Console.Write(ch + " ");
        }
        Console.WriteLine();
    }
Beispiel #11
0
        static void Main(string[] args)
        {
            StringDisperser stringDisperser = new StringDisperser("Nakov", "Nasko", "Dancho");

            foreach (var ch in stringDisperser)
            {
                Console.Write(ch + " ");
            }
            Console.WriteLine();
        }
Beispiel #12
0
    static void Main()
    {
        StringDisperser stringDisperser = new StringDisperser("gosho", "pesho", "tanio");
        foreach (var ch in stringDisperser)
        {
            Console.Write(ch + " ");
        }

        StringDisperser stringDisperser2 = stringDisperser.Clone() as StringDisperser;
        Console.WriteLine(stringDisperser.Equals(stringDisperser2)); //da
        Console.WriteLine(stringDisperser == stringDisperser2); //ne
    }
        public static void Main()
        {
            try
            {
                StringDisperser stringDisperser = new StringDisperser("gosho", "pesho", "tanio");

                Console.WriteLine("String disperser info: {0}", stringDisperser);

                StringDisperser clonedStringDisperser = (StringDisperser) stringDisperser.Clone();

                Console.WriteLine();
                Console.WriteLine("Cloned string disperser info before changes: {0}", clonedStringDisperser);
                Console.WriteLine("Is string disperser equal to cloned string disperser?: {0}",
                    stringDisperser.Equals(clonedStringDisperser));

                clonedStringDisperser.Name1 = "Sergei";
                clonedStringDisperser.Name2 = "Mestan";
                clonedStringDisperser.Name3 = "Koburgotski";

                Console.WriteLine();
                Console.WriteLine("Cloned string disperser info after changes: {0}", clonedStringDisperser);
                Console.WriteLine("Is string disperser equal to cloned string disperser?: {0}",
                    stringDisperser.Equals(clonedStringDisperser));

                Console.WriteLine();
                Console.WriteLine("Who is greater - string disperser or cloned string disperser?: {0}",
                    stringDisperser.CompareTo(clonedStringDisperser));

                Console.WriteLine();
                Console.WriteLine("Foreach test for string dispersers: ");
                Console.WriteLine();

                foreach (var ch in stringDisperser)
                {
                    Console.Write(ch + " ");
                }

                Console.WriteLine();

                foreach (var ch in clonedStringDisperser)
                {
                    Console.Write(ch + " ");
                }

                Console.WriteLine();
            }

            catch (ArgumentNullException ex)
            {
                Console.Error.WriteLine(ex.Message);
            }
        }
        public static void Main()
        {
            var disperserOne = new StringDisperser("gosho", "pesho", "tanio");
            var disperserTwo = disperserOne.Clone();
            Console.WriteLine("Cloned disperser are equal with original: {0}", disperserOne.Equals(disperserTwo));
            Console.WriteLine("Cloned disperser are same object as original: {0}", object.ReferenceEquals(disperserOne, disperserTwo));
            Console.Write("Enumerated content: ");
            foreach (var ch in disperserOne)
            {
                Console.Write(ch + " ");
            }

            Console.WriteLine();
            Console.ReadKey();
        }
 static void Main()
 {
     StringDisperser disperser = new StringDisperser("hello", "world");
     Console.WriteLine(disperser);
     foreach (var ch in disperser)
     {
         Console.Write(ch + " ");
     }
     StringDisperser disperser2 = new StringDisperser("hey", "man!");
     Console.WriteLine();
     Console.WriteLine(disperser.CompareTo(disperser2));
     StringDisperser disperser2Copy = (StringDisperser)disperser2.Clone();
     disperser2Copy.Strings[0] = "new";
     Console.WriteLine(disperser2Copy);
     Console.WriteLine(disperser2);
 }
        public static void Main(string[] args)
        {
            StringDisperser sd1 = new StringDisperser("Pavel", "Ilchev");
            StringDisperser sd2 = new StringDisperser("Natali", "Nikolova");

            Console.WriteLine(sd1 == sd2);

            StringDisperser copy = sd1.Clone();

            foreach (var s in sd1)
            {
                Console.Write(s + " ");
            }

            Console.ReadKey(true);
        }
        static void Main()
        {
            StringDisperser stringDisperser = new StringDisperser("lili", "gosho", "emo");
            StringDisperser stringDisperserCopy = (StringDisperser)stringDisperser.Clone();
            stringDisperserCopy.TotalString.Append("viki");
            foreach (var ch in stringDisperser)
            {
                Console.Write(ch + " ");
            }

            Console.WriteLine();
            foreach (var ch in stringDisperserCopy)
            {
                Console.Write(ch + " ");
            }
        }
Beispiel #18
0
    static void Main()
    {
        StringDisperser firstStringDisperser  = new StringDisperser("hello", "beautifull", "World!");
        StringDisperser secondStringDisperser = new StringDisperser("gosho", "pesho", "tanio");
        StringDisperser thirdStringDisperser  = (StringDisperser)firstStringDisperser.Clone();

        Console.WriteLine(firstStringDisperser + "\n");

        Console.WriteLine(firstStringDisperser.Equals(secondStringDisperser));
        Console.WriteLine(firstStringDisperser.Equals(thirdStringDisperser) + "\n");

        foreach (string character in secondStringDisperser)
        {
            Console.Write(character);
        }

        Console.WriteLine();
    }
Beispiel #19
0
        public static void Main()
        {
            StringDisperser stringDisperser = new StringDisperser("gosho", "pesho", "tanio");
            Console.WriteLine(stringDisperser);
            foreach (var ch in stringDisperser)
            {
                Console.Write(ch + " ");
            }
            Console.WriteLine();

            StringDisperser otherDisperser = new StringDisperser("alabala", "portokala");
            Console.WriteLine(otherDisperser);
            Console.WriteLine(otherDisperser == stringDisperser);
            Console.WriteLine(otherDisperser.CompareTo(stringDisperser));

            StringDisperser clonedDisperser = stringDisperser.Clone();
            Console.WriteLine(clonedDisperser);
        }
        static void Main(string[] args)
        {
            StringDisperser stringDisperser = new StringDisperser("gosho", "pesho", "tanio");

            StringDisperser secondStringDisperser = new StringDisperser("gosho", "pesho", "tanio");

            StringDisperser clonedStringDisparser = (StringDisperser)secondStringDisperser.Clone();

            Console.WriteLine(stringDisperser == secondStringDisperser);
            Console.WriteLine(secondStringDisperser.Equals(clonedStringDisparser));

            Console.WriteLine(stringDisperser.CompareTo(secondStringDisperser));

            foreach (var ch in stringDisperser)
            {
                Console.Write(ch + " ");
            }
            Console.WriteLine();
        }
    static void Main()
    {
        StringDisperser first = new StringDisperser("gosho", "pesho");
        StringDisperser second = new StringDisperser("gosho", "pesho");
        StringDisperser third = new StringDisperser("notgosho", "pesho");

        foreach (var ch in first)
        {
            Console.Write(ch + " ");
        }
        Console.WriteLine();

        Console.WriteLine(first == second);
        Console.WriteLine(first != third);

        third = (StringDisperser)first.Clone();

        Console.WriteLine(Object.ReferenceEquals(first, third));
        Console.WriteLine(first == third);
        Console.WriteLine(first.ToString());
    }
Beispiel #22
0
    public object Clone()
    {
        var cloning = new StringDisperser((string[])this.strings.Clone());

        return(cloning);
    }
Beispiel #23
0
        static void Main()
        {
            StringDisperser stringDisperser = new StringDisperser("gosho", "pesho", "tanio");

            Console.WriteLine(string.Join(" ", stringDisperser));
        }
 public object Clone()
 {
     var cloning = new StringDisperser((string[])this.strings.Clone());
     return cloning;
 }