Meziantou.Framework.FixedStringBuilder
2.0.8
Prefix Reserved
dotnet add package Meziantou.Framework.FixedStringBuilder --version 2.0.8
NuGet\Install-Package Meziantou.Framework.FixedStringBuilder -Version 2.0.8
<PackageReference Include="Meziantou.Framework.FixedStringBuilder" Version="2.0.8" />
<PackageVersion Include="Meziantou.Framework.FixedStringBuilder" Version="2.0.8" />
<PackageReference Include="Meziantou.Framework.FixedStringBuilder" />
paket add Meziantou.Framework.FixedStringBuilder --version 2.0.8
#r "nuget: Meziantou.Framework.FixedStringBuilder, 2.0.8"
#:package Meziantou.Framework.FixedStringBuilder@2.0.8
#addin nuget:?package=Meziantou.Framework.FixedStringBuilder&version=2.0.8
#tool nuget:?package=Meziantou.Framework.FixedStringBuilder&version=2.0.8
Meziantou.Framework.FixedStringBuilder
Meziantou.Framework.FixedStringBuilder provides fixed-capacity string value types for low-allocation text operations.
Built-in fixed-capacity types
The package includes the following types:
FixedStringBuilder8FixedStringBuilder16FixedStringBuilder32FixedStringBuilder64
They are in the Meziantou.Framework.FixedStringBuilder namespace.
FixedStringBuilder16 sb = $"Hello {"World"}";
sb.AppendLiteral("!");
string str = sb.ToString();
Assert.Equal("Hello World!", str);
If a value does not fit in the configured capacity, operations throw ArgumentException.
Clear() only resets the length: the characters stay in the underlying buffer. Use Clear(zeroBuffer: true) to also
overwrite the whole buffer with '\0'.
FixedStringBuilder16 sb = $"secret";
sb.Clear(zeroBuffer: true);
Assert.Equal(0, sb.Length);
Create a custom fixed-capacity type
The package Meziantou.Framework.FixedStringBuilder.Generator includes a source generator. Declare a partial struct with FixedStringBuilderAttribute:
[FixedStringBuilderAttribute(128)]
public partial struct FixedStringBuilder128;
The generated struct supports the same APIs as the built-in types (Length, Clear, TryFormat, interpolation, equality, and conversions from string).
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. net11.0 is compatible. |
-
net10.0
- No dependencies.
-
net11.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.8 | 129 | 11/13/2026 |
| 2.0.7 | 112 | 11/8/2026 |
| 2.0.6 | 185 | 10/28/2026 |
| 2.0.5 | 120 | 10/21/2026 |
| 2.0.4 | 365 | 9/13/2026 |
| 2.0.3 | 139 | 9/6/2026 |
| 2.0.2 | 137 | 8/30/2026 |
| 2.0.1 | 144 | 8/29/2026 |
| 2.0.0 | 548 | 7/5/2026 |
| 1.0.5 | 481 | 6/13/2026 |
| 1.0.4 | 159 | 6/7/2026 |
| 1.0.3 | 142 | 5/23/2026 |
| 1.0.2 | 141 | 4/25/2026 |
| 1.0.1 | 156 | 4/12/2026 |
| 1.0.0 | 151 | 4/6/2026 |