Getting started
The following section will show you how to use the ValueStringBuilder
.
For .NET 6 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()
{
var stringBuilder = new ValueStringBuilder();
stringBuilder.AppendLine("Hello World!");
stringBuilder.Append(0.3f);
stringBuilder.Insert(6, "dear ");
Console.WriteLine(stringBuilder.ToString());
}
}
Prints:
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 ValueStringBuilder
nuget package included in the latest version.
Helper methods
There are also very easy-to-use helper methods, which doesn't need a ValueStringBuilder
instance:
using LinkDotNet.StringBuilder;
string helloWorld = ValueStringBuilder.Concat("Hello World!", 101);