Instance Method

remove​Subrange(_:​)

Removes the characters in the given range.

Declaration

mutating func removeSubrange(_ bounds: Range<String.Index>)

Parameters

bounds

The range of the elements to remove. The upper and lower bounds of bounds must be valid indices of the string.

Discussion

Calling this method invalidates any existing indices for use with this string.