private/runtime/Helpers/Extensions/StringBuilderExtensions.cs

using System.Text;

namespace Carbon.Internal.Extensions
{
    internal static class StringBuilderExtensions
    {
        /// <summary>
        /// Extracts the buffered value and resets the buffer
        /// </summary>
        public static string Extract(this StringBuilder builder)
        {
            var text = builder.ToString();

            builder.Clear();

            return text;
        }
    }
}