Sdílet prostřednictvím


AbstractStringBuilder.EnsureCapacity(Int32) Method

Definition

Ensures that the capacity is at least equal to the specified minimum.

[Android.Runtime.Register("ensureCapacity", "(I)V", "GetEnsureCapacity_IHandler")]
public virtual void EnsureCapacity (int minimumCapacity);
[<Android.Runtime.Register("ensureCapacity", "(I)V", "GetEnsureCapacity_IHandler")>]
abstract member EnsureCapacity : int -> unit
override this.EnsureCapacity : int -> unit

Parameters

minimumCapacity
Int32

the minimum desired capacity.

Attributes

Remarks

Ensures that the capacity is at least equal to the specified minimum. If the current capacity is less than the argument, then a new internal array is allocated with greater capacity. The new capacity is the larger of: <ul> <li>The minimumCapacity argument. <li>Twice the old capacity, plus 2. </ul> If the minimumCapacity argument is nonpositive, this method takes no action and simply returns. Note that subsequent operations on this object can reduce the actual capacity below that requested here.

Java documentation for java.lang.AbstractStringBuilder.ensureCapacity(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to