Instance Method

replaceCharactersInRange:withString:

Replaces the characters from aRange with those in aString.

Declaration

- (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)aString;

Parameters

aRange

The range of characters to replace. aRange must not exceed the bounds of the receiver.

aString

The string with which to replace the characters in aRange. 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

- appendFormat:

Adds a constructed string to the receiver.

- appendString:

Adds to the end of the receiver the characters of a given string.

- applyTransform:reverse:range:updatedRange:

Transliterates the receiver by applying a specified ICU string transform.

- deleteCharactersInRange:

Removes from the receiver the characters in a given range.

- insertString:atIndex:

Inserts into the receiver the characters of a given string at a given location.

- replaceOccurrencesOfString:withString:options:range:

Replaces all occurrences of a given string in a given range with another given string, returning the number of replacements.

- setString:

Replaces the characters of the receiver with those in a given string.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software