Simply awesomeThe #1 ASP/ASP.NET Developer Community

StringBuilder.EnsureCapacity Method

System.Text Namespace   StringBuilder Class


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

[ VB ]
<Serializable>
Public Function EnsureCapacity ( _
   ByVal capacity As Integer _
) As Integer

[ C# ]
[Serializable]
public int EnsureCapacity ( 
   int capacity
);

[ C++ ]
[Serializable]
public: int EnsureCapacity ( 
   int capacity
);

[ JScript ]
public Serializable
function EnsureCapacity ( 
   capacity : int
) : int;

Parameters

capacity
The minimum capacity to ensure.

Return Value

The current capacity of this instance.

Exceptions


Exception Type Condition
ArgumentOutOfRangeException capacity is less than zero.

Remarks

If the number of characters in this instance is less than or equal to the capacity parameter, memory for this instance is reallocated to hold at least capacity number of characters; otherwise, no memory is changed. In either case, the current value of the Capacity property is returned.

See Also

StringBuilder Members


Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note