Initializer

init(capacity:)

Returns an NSMutableString object initialized with initial storage for a given number of characters,

Declaration

init(capacity: Int)

Parameters

capacity

The number of characters the string is expected to initially contain.

Return Value

An initialized NSMutableString object with initial storage for capacity characters. The returned object might be different than the original receiver.

Discussion

The number of characters indicated by capacity is simply a hint to increase the efficiency of data storage. The value does not limit the length of the string.