Exemple #1
0
        private void InsertAlignment(int startingPos, int alignment)
        {
            var charsWritten = _stringBuilder._length - startingPos;

            var paddingNeeded = alignment - charsWritten;

            if (paddingNeeded > 0)
            {
                var chars = _stringBuilder._chars;
                if (chars.Length - _stringBuilder._length < paddingNeeded)
                {
                    _stringBuilder.Grow(paddingNeeded);
                }

                chars.Slice(startingPos, charsWritten).CopyTo(chars[(startingPos + paddingNeeded)..]);