Contents

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. range must not exceed the bounds of the receiver.

  • aString:

    The string with which to replace the characters in range. aString must not be nil.

Discussion

This method treats the length of the string as a valid range value that returns an empty string.

See Also

Modifying a String