Replaces the text within the specified bounds with the given characters.
- Xcode 8.0+
- Swift Standard Library
The range of text to replace. The bounds of the range must be valid indices of the string.
The new characters to add to the string.
Calling this method invalidates any existing indices for use with this string.
Complexity: O(m), where m is the combined length of the string and
new. If the call to
replace simply removes text at the end of the string, the complexity is O(n), where n is equal to