Exemple #1
0
        public static StrArr UniqueConcat(StrArr a, StrArr b)
        {
            int length = 0;

            if (a.Length() > b.Length())
            {
                length = a.Length();
            }
            else
            {
                length = b.Length();
            }
            var arr = new StrArr(length, a.MaxLength + b.MaxLength);

            int[] x = new int[10];
            for (int i = 0; i < length; i++)
            {
                if (a[i] == b[i])
                {
                    arr[i] = a[i];
                }
                else
                {
                    arr[i] = a[i] + b[i];
                }
            }
            return(arr);
        }
Exemple #2
0
        public static StrArr Concatination(StrArr a, StrArr b)
        {
            int maxLengt = a.Length() + b.Length();
            int length   = 0;

            if (a.MaxLength > b.MaxLength)
            {
                length = a.MaxLength;
            }
            else
            {
                length = b.MaxLength;
            }
            var arr = new StrArr(length, maxLengt);

            for (int i = 0; i < length; i++)
            {
                if (i % 2 == 0)
                {
                    arr[i] = a[i % 2];
                }
                else
                {
                    arr[i] = b[i % 2];
                }
            }
            return(arr);
        }