Replaces all occurrences of a given string in a given range with another given string, returning the number of replacements.
Original signature is '- (NSUInteger)replaceOccurrencesOfString:(NSString *)target withString:(NSString *)replacement options:(NSStringCompareOptions)opts range:(NSRange)searchRange'
Available in Mac OS X v10.2 and later.

C# | Visual Basic | Visual C++ |
public virtual NSUInteger ReplaceOccurrencesOfStringWithStringOptionsRange( NSString target, NSString replacement, NSStringCompareOptions opts, NSRange searchRange )
Public Overridable Function ReplaceOccurrencesOfStringWithStringOptionsRange ( _ target As NSString, _ replacement As NSString, _ opts As NSStringCompareOptions, _ searchRange As NSRange _ ) As NSUInteger
public: virtual NSUInteger ReplaceOccurrencesOfStringWithStringOptionsRange( NSString^ target, NSString^ replacement, NSStringCompareOptions opts, NSRange searchRange )

- target (NSString)
- The string to replace.
- replacement (NSString)
- The string with which to replace target.
- opts (NSStringCompareOptions)
- A mask specifying search options. See String Programming Guide for details.
- searchRange (NSRange)
- The range of characters to replace. aRange must not exceed the bounds of the receiver. Specify searchRange as NSMakeRange(0, [receiver length]) to process the entire string.

The number of replacements made.

- Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)