replaceCharacters(in:with:)
Replaces the characters from range with those in aString.
Declaration
func replaceCharacters(in range: NSRange, with aString: String)Parameters
- range:
The range of characters to replace.
rangemust not exceed the bounds of the receiver. - aString:
The string with which to replace the characters in
range.aStringmust not benil.
Discussion
This method treats the length of the string as a valid range value that returns an empty string.