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

Join() public method

Joins some elements of the sequence to whole composed string
public Join ( int pos, int len ) : void
pos int cursorPosition in the sequence at which to begin the gluing
len int how many words need to join including first word
return void
        public void Join(int pos, int len)
        {
            int wordEnd = pos + len;
            var temporarySplice = new StringBuilder();
            temporarySplice.Clear();
            if (wordEnd > GetLength())
            {
                return;
            }

            for (int index = pos; index < wordEnd; index++)
            {
                temporarySplice.Append(this[index]);
            }

            for (int i = 0; i < len - 1; i++)
            {
                DeleteAt(pos);
            }

            Set(new ValueString(temporarySplice.ToString()), pos);
        }