Created
January 6, 2014 08:10
-
-
Save swkwon/8279720 to your computer and use it in GitHub Desktop.
concat3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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