NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

StringBuilder.Capacity

Retrieves or assigns the capacity of the current StringBuilder, which is the number of characters the current StringBuilder is capable of holding.

[Visual Basic]
Public Property Capacity As Integer
[C#]
public int Capacity {get; set;}
[C++]
public: __property int get_Capacity();
public: __property void set_Capacity(int);
[JScript]
public function get Capacity() : int;
public function set Capacity(int);

Property Value

Read/write. This property retrieves or assigns the capacity of the current StringBuilder.

Exceptions

Exception Type Condition
ArgumentException if an attempt is made to assign a capacity that is less than the current capacity.

Remarks

The default capacity is 16. If a value is assigned that is greater than the current capacity, memory is allocated to allow the StringBuilder to grow.

See Also

StringBuilder Class | StringBuilder Members | System.Text Namespace