public override StringRebuilder Substring(Span span)
        {
            if (span.End > this.Length)
            {
                throw new ArgumentOutOfRangeException("span");
            }

            if (span.Length == this.Length)
            {
                return(this);
            }
            else if (span.End <= _left.Length)
            {
                return(_left.Substring(span));
            }
            else if (span.Start >= _left.Length)
            {
                return(_right.Substring(new Span(span.Start - _left.Length, span.Length)));
            }
            else
            {
                return(BinaryStringRebuilder.Create(_left.Substring(Span.FromBounds(span.Start, _left.Length)),
                                                    _right.Substring(Span.FromBounds(0, span.End - _left.Length))));
            }
        }
        public static StringRebuilder Create(StringRebuilder left, StringRebuilder right)
        {
            if (left == null)
            {
                throw new ArgumentNullException("left");
            }
            if (right == null)
            {
                throw new ArgumentNullException("right");
            }

            if (left.Length == 0)
            {
                return(right);
            }
            else if (right.Length == 0)
            {
                return(left);
            }
            else if ((left.Length + right.Length < TextModelOptions.StringRebuilderMaxCharactersToConsolidate) &&
                     (left.LineBreakCount + right.LineBreakCount <= TextModelOptions.StringRebuilderMaxLinesToConsolidate))
            {
                //Consolidate the two rebuilders into a single simple string rebuilder
                return(SimpleStringRebuilder.Create(left, right));
            }
            else if (right.StartsWithNewLine && left.EndsWithReturn)
            {
                //Don't allow a line break to be broken across the seam
                return(BinaryStringRebuilder.Create(BinaryStringRebuilder.Create(left.Substring(new Span(0, left.Length - 1)),
                                                                                 _crlf),
                                                    right.Substring(Span.FromBounds(1, right.Length))));
            }
            else
            {
                return(BinaryStringRebuilder.BalanceStringRebuilder(left, right));
            }
        }