StringBuilder.Capacity : StringBuilder « System.Text « C# / C Sharp by API






StringBuilder.Capacity

  

using System;
using System.Text;

class StringApp {
    static void Main(string[] args) {
        StringBuilder myBuffer = new StringBuilder("My string data");
        Console.WriteLine(myBuffer.Capacity);
        myBuffer.Append(" contains some numerical data: ");
        myBuffer.AppendFormat("{0}, {1}.", 44, 99);
        Console.WriteLine(myBuffer.Capacity);
        Console.WriteLine(myBuffer);

    }
}

   
    
  








Related examples in the same category

1.new StringBuilder()
2.StringBuilder.Append
3.StringBuilder.AppendFormat
4.StringBuilder.GetType()
5.StringBuilder.Insert
6.StringBuilder.Length
7.StringBuilder.Remove
8.StringBuilder.Replace
9.StringBuilder.ToString()