How to

efficiently concat multiple strings

Published: 26. September 2011 | Updated: 26. October 2011
License: Microsoft Public License (MS-PL)
Categories: Framework » Strings
Tags: C# Performance Text
Was this snippet helpful for you? YESYES / NONO

Import namespace

using System.Text;

Code

var builder = new StringBuilder();
builder.Append("test");
builder.Append(50);
builder.AppendFormat("test {0}", 50);
builder.AppendLine();
var text = builder.ToString();
Send us feedback about this snippet »



Related Snippets: