Soenneker.Utils.PooledStringBuilders
4.0.22
Prefix Reserved
dotnet add package Soenneker.Utils.PooledStringBuilders --version 4.0.22
NuGet\Install-Package Soenneker.Utils.PooledStringBuilders -Version 4.0.22
<PackageReference Include="Soenneker.Utils.PooledStringBuilders" Version="4.0.22" />
<PackageVersion Include="Soenneker.Utils.PooledStringBuilders" Version="4.0.22" />
<PackageReference Include="Soenneker.Utils.PooledStringBuilders" />
paket add Soenneker.Utils.PooledStringBuilders --version 4.0.22
#r "nuget: Soenneker.Utils.PooledStringBuilders, 4.0.22"
#:package Soenneker.Utils.PooledStringBuilders@4.0.22
#addin nuget:?package=Soenneker.Utils.PooledStringBuilders&version=4.0.22
#tool nuget:?package=Soenneker.Utils.PooledStringBuilders&version=4.0.22
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)whereT : ISpanFormattableAppendSpan(int length)? write directly into the bufferAppendLine(),AppendSeparatorIfNotEmpty(char)Length,Capacity,Clear()ToString()(keep using; you mustDispose()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 crossawait.- Dispose when done.
usingshould be used, or there isToStringAndDispose(). 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 | Versions 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. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (12)
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.Cosmos.Repository
A data persistence abstraction layer for Cosmos DB |
|
|
Soenneker.Extensions.Spans.Readonly.Chars
A collection of helpful ReadOnlySpan (char) extension methods |
|
|
Soenneker.Extensions.HttpContent
A collection of helpful HttpContent extension methods |
|
|
Soenneker.Utils.String
A utility library for useful String operations |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.22 | 55,895 | 4/23/2026 |
| 4.0.21 | 238,314 | 3/14/2026 |
| 4.0.16 | 114,512 | 3/10/2026 |
| 4.0.15 | 56,579 | 3/9/2026 |
| 4.0.14 | 665 | 3/9/2026 |
| 4.0.13 | 91,731 | 3/4/2026 |
| 4.0.12 | 141,647 | 2/21/2026 |
| 4.0.11 | 4,970 | 2/21/2026 |
| 4.0.10 | 91,865 | 2/4/2026 |
| 4.0.9 | 94,430 | 1/8/2026 |
| 4.0.8 | 17,919 | 1/2/2026 |
| 4.0.7 | 36,865 | 11/20/2025 |
| 4.0.6 | 24,885 | 10/29/2025 |
| 3.0.5 | 3,237 | 10/23/2025 |
| 3.0.4 | 35,663 | 9/16/2025 |
| 3.0.3 | 340 | 9/16/2025 |
| 3.0.2 | 1,632 | 9/15/2025 |
| 3.0.1 | 319 | 9/15/2025 |
Merge branch 'main' of https://github.com/soenneker/soenneker.utils.pooledstringbuilders
# Conflicts:
# test/Soenneker.Utils.PooledStringBuilders.Tests/Soenneker.Utils.PooledStringBuilders.Tests.csproj