Home > DeveloperSection > Articles > String Builder in C sharp .NET

String Builder in C sharp .NET

ADO.Net ADO.Net 
1 Comment(s)
 6001  View(s)
Rate this:

String Builder in C#.Net

StringBuilder is a dynamic string array, in which we can append any number of strings.


  StringBuilder sb = new StringBuilder();

//creating new string builder onject.

        private void button1_Click(object sender, EventArgs e)



//adding value to string builder

            textBox1.Text = "";



        private void button2_Click(object sender, EventArgs e)


MessageBox.Show("Capacity: " + sb.Capacity.ToString() + "\nValue: " + sb.ToString() + "\nLength: " + sb.Length.ToString());     

//displaying capacity, length and value of stringbuilder    



Screen shot



By Sunil Singh on   one month ago

Keep sharing these types of articles.

Don't want to miss updates? Please click the below button!

Follow MindStick