Meziantou.Framework.FixedStringBuilder 2.0.2

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Meziantou.Framework.FixedStringBuilder --version 2.0.2
                    
NuGet\Install-Package Meziantou.Framework.FixedStringBuilder -Version 2.0.2
                    
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="Meziantou.Framework.FixedStringBuilder" Version="2.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Meziantou.Framework.FixedStringBuilder" Version="2.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Meziantou.Framework.FixedStringBuilder" />
                    
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 Meziantou.Framework.FixedStringBuilder --version 2.0.2
                    
#r "nuget: Meziantou.Framework.FixedStringBuilder, 2.0.2"
                    
#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 Meziantou.Framework.FixedStringBuilder@2.0.2
                    
#: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=Meziantou.Framework.FixedStringBuilder&version=2.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Meziantou.Framework.FixedStringBuilder&version=2.0.2
                    
Install as a Cake Tool

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:

  • FixedStringBuilder8
  • FixedStringBuilder16
  • FixedStringBuilder32
  • FixedStringBuilder64
using Meziantou.Framework.FixedStringBuilder;

FixedStringBuilder16 sb = $"Hello {"World"}";
sb.AppendLiteral("!");

string str = sb.ToString();

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);

Create a custom fixed-capacity type

The package Meziantou.Framework.FixedStringBuilder.Generator includes a source generator. Declare a partial struct with FixedStringBuilderAttribute:

using Meziantou.Framework.FixedStringBuilder;

[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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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