
Append method calls can be chained. This makes your StringBuilder code more succinct and easier to read. Instead of using dozens of Append lines, we can have just one. And in some program contexts this is ideal.

To start, we see how many developers use StringBuilder. Remember that StringBuilder often improves your application's performance, and is an important part of your tool belt as a developer. Here's some sample StringBuilder code that uses the regular syntax.
These C# examples show ways you can use the StringBuilder Append method.
Program that uses Append syntax [C#]
using System.Text;
class Program
{
static void Main()
{
// Conventional StringBuilder syntax.
const string s = "Value";
StringBuilder builder = new StringBuilder();
for (int i = 0; i < 1000; i++)
{
builder.Append("One string ");
builder.Append(s);
builder.Append("Another string");
}
}
}
Program that uses altenative Append syntax [C#]
using System.Text;
class Program
{
static void Main()
{
// This is a fluent interface for StringBuilder.
const string s = "Value";
StringBuilder builder = new StringBuilder();
for (int i = 0; i < 1000; i++)
{
builder.Append("One string ").Append(s).Append("Another string");
}
}
}
Overview. Here we look at how you can combine multiple Append calls into a single statement. StringBuilder's Append() method returns a reference to itself. The designers of C# foresaw the problem with repetitive StringBuilder appends. They are ugly and verbose, and thus prone to errors. Here we chain StringBuilder Append calls.

Another option when you want to Append string together is to just use the + plus operator on the string type. Note that this approach has different performance characteristics, but is actually useful in many situations when you are not looping over strings.
String Append: Add Strings Together
In this example, we saw how you can improve the syntax of your StringBuilder code. Use this syntax to chain your StringBuilders in cases where you call Append multiple times. It retains the enormous performance advantage of StringBuilder, and approximates the simple syntax of regular strings: the best of both worlds.
StringBuilder Append Performance StringBuilder Secrets