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.EnsureCapacity

Ensures that the capacity of the current StringBuilder is at least the specified value.

[Visual Basic]
Public Function EnsureCapacity( _
   ByVal capacity As Integer _
) As Integer
[C#]
public int EnsureCapacity(
   int capacity
);
[C++]
public: int EnsureCapacity(
   int capacity
);
[JScript]
public function EnsureCapacity(
   capacity : int
) : int;

Parameters

capacity
the minimum capacity to ensure.

Return Value

Returns the capacity of the current string, after any changes to Capacity.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException if capacity is less than the capacity of the current StringBuilder.

Remarks

If capacity is greater than the capacity of the current StringBuilder, then Capacity is set to capacity; otherwise Capacity is unchanged.

See Also

StringBuilder Class | StringBuilder Members | System.Text Namespace