Removes and returns the character at the specified position.
SDK
- Xcode 10.0+
Framework
- Swift Standard Library
Declaration
Parameters
i
The position of the character to remove.
i
must be a valid index of the string that is not equal to the string’s end index.
Return Value
The character that was removed.
Discussion
All the elements following i
are moved to close the gap. This example removes the hyphen from the middle of a string.
Calling this method invalidates any existing indices for use with this string.