Skip to content

Instantly share code, notes, and snippets.

@swkwon
Created January 6, 2014 08:10
Show Gist options
  • Save swkwon/8279720 to your computer and use it in GitHub Desktop.
Save swkwon/8279720 to your computer and use it in GitHub Desktop.
concat3
class StringBuilderTest
{
static void Main()
{
string text = null;
// Use StringBuilder for concatenation in tight loops.
System.Text.StringBuilder sb = new System.Text.StringBuilder();
for (int i = 0; i < 100; i++)
{
sb.AppendLine(i.ToString());
}
System.Console.WriteLine(sb.ToString());
// Keep the console window open in debug mode.
System.Console.WriteLine("Press any key to exit.");
System.Console.ReadKey();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment