Segmenter.Base.Sequences.ComplexChain.Concat C# (CSharp) Method

Concat() public method

The concat.
public Concat ( ComplexChain sequence ) : ComplexChain
sequence ComplexChain /// The sequence. ///
return ComplexChain
        public ComplexChain Concat(ComplexChain sequence)
        {
            if (sequence.IsEmpty())
            {
                return this;
            }

            ComplexChain temp = Clone();

            ClearAndSetNewLength(GetLength() + sequence.GetLength());
            for (int i = 0; i < temp.GetLength(); i++)
            {
                this[i] = temp[i];
            }

            for (int j = 0; j < sequence.GetLength(); j++)
            {
                this[j + temp.GetLength()] = sequence[j];
            }

            return this;
        }

Same methods

ComplexChain::Concat ( string str ) : ComplexChain

Usage Example

コード例 #1
0
        public void ConcatTwoTest()
        {
            int start = 0;
            int end = chain.GetLength();

            var firstComplexChain = new ComplexChain(chain.Substring(start, end - 1));
            var secondComplexChain = new ComplexChain(chain.Substring(end - 1, end));
            ComplexChain concatChain = firstComplexChain.Concat(secondComplexChain.ToString());
            Assert.True(concatChain.Equals(chain));
        }
All Usage Examples Of Segmenter.Base.Sequences.ComplexChain::Concat