Beispiel #1
0
        public static RussianText operator ^(RussianText rt1, RussianText rt2)
        {
            RussianString[] all = new RussianString[rt1.rText.Length + rt2.rText.Length];
            for (int i = 0; i < rt1.rText.Length; ++i)
                all[i] = rt1.rText[i];
            for (int j = rt1.rText.Length, k = 0; j < all.Length; ++j, ++k)
                all[j] = rt2.rText[k];
            all = all.Distinct().ToArray();

            RussianText unique = new RussianText(all);
            return unique;
        }
Beispiel #2
0
        public static RussianText operator +(RussianText rt1, RussianText rt2)
        {
            RussianString[] rText = new RussianString[Math.Max(rt1.rText.Length, rt2.rText.Length)];
            for (int i = 0; i < rText.Length; ++i)
            {
                rText[i] = "";
                if (i < rt1.rText.Length)
                    rText[i] += rt1[i];
                if (i < rt2.rText.Length)
                    rText[i] += rt2[i];
            }

            RussianText sum = new RussianText(rText);

            return sum;
        }