Soenneker.Utils.PooledStringBuilders 4.0.7

Prefix Reserved
dotnet add package Soenneker.Utils.PooledStringBuilders --version 4.0.7
                    
NuGet\Install-Package Soenneker.Utils.PooledStringBuilders -Version 4.0.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Soenneker.Utils.PooledStringBuilders" Version="4.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.PooledStringBuilders" Version="4.0.7" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Utils.PooledStringBuilders" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Soenneker.Utils.PooledStringBuilders --version 4.0.7
                    
#r "nuget: Soenneker.Utils.PooledStringBuilders, 4.0.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Soenneker.Utils.PooledStringBuilders@4.0.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Soenneker.Utils.PooledStringBuilders&version=4.0.7
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.PooledStringBuilders&version=4.0.7
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Utils.PooledStringBuilders

Tiny, fast ref struct string builder. Backed by ArrayPool<char>. Low allocations. Short-lived use.

Install

dotnet add package Soenneker.Utils.PooledStringBuilders

Example

using Soenneker.Utils.PooledStringBuilders;

using var sb = new PooledStringBuilder(128);

sb.Append("Hello, ");
sb.Append(name);
sb.Append(' ');
sb.Append(id);        // ISpanFormattable path, no boxing
sb.AppendLine();

string s = sb.ToString(); // returns string + returns buffer

Cheatsheet

  • new PooledStringBuilder(int capacity = 128)
  • Append(char), Append(string?), Append(ReadOnlySpan<char>)
  • Append<T>(T value, ReadOnlySpan<char> fmt = default, IFormatProvider? prov = null) where T : ISpanFormattable
  • AppendSpan(int length) → write directly into the buffer
  • AppendLine(), AppendSeparatorIfNotEmpty(char)
  • Length, Capacity, Clear()
  • ToString() (keep using; you must Dispose() later)
  • ToStringAndDispose(bool clear = false) (one-shot finish)
  • Dispose() / Dispose(bool clear)

Notes

  • ref struct → stack-only. Don’t capture, box, store in fields, or cross await.
  • Dispose when done. using should be used, or there is ToStringAndDispose(). Don't use both.
  • Handling secrets? Use ToStringAndDispose(clear: true) to zero the array before returning to the pool.
  • Not thread-safe. Keep it short-lived and single-scope.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Soenneker.Utils.PooledStringBuilders:

Package Downloads
Soenneker.Redis.Util

The general purpose utility library leveraging Redis for all of your caching needs

Soenneker.Extensions.Object

A collection of helpful Object extension methods

Soenneker.Utils.Dotnet

A utility library for the dotnet executable

Soenneker.Quark.Suite

The entire suite of Quark elements, all in one library.

Soenneker.Quark.Variables.Bootstrap

CSS variable overrides for the latest version of Bootstrap.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.7 5,004 11/20/2025
4.0.6 24,780 10/29/2025
3.0.5 2,985 10/23/2025
3.0.4 35,542 9/16/2025
3.0.3 298 9/16/2025
3.0.2 1,579 9/15/2025
3.0.1 277 9/15/2025