Getting started
The following section will show you how to use the ValueStringBuilder
.
For .NET 8.0+ use the nuget-package:
PM> Install-Package LinkDotNet.StringBuilder
Now that the package is installed the library can be used:
using System;
using LinkDotNet.StringBuilder; // Namespace of the library
public static class Program
{
public static void Main()
{
using var stringBuilder = new ValueStringBuilder();
stringBuilder.AppendLine("Hello World!");
stringBuilder.Append(0.3f);
stringBuilder.Insert(6, "dear ");
Console.WriteLine(stringBuilder.ToString());
}
}
Here is an interactive example where you can fiddle around with the library. The example is hosted on https://dotnetfiddle.net and already has the latest ValueStringBuilder
NuGet package installed.
Helper methods
There are also some static helper methods:
using LinkDotNet.StringBuilder;
string helloWorld = ValueStringBuilder.Concat("Hello World!", 101);