MonobjcMonobjc Documented Class Library
ReplaceOccurrencesOfStringWithStringOptionsRange Method (target, replacement, opts, searchRange)
NamespacesMonobjc.FoundationNSMutableStringReplaceOccurrencesOfStringWithStringOptionsRange(NSString, NSString, NSStringCompareOptions, NSRange)

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.

Declaration Syntax
C#Visual BasicVisual 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
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.
Return Value
The number of replacements made.
Version Information
  • Available in Monobjc Bridge: 10.6 (For Mac OS X 10.6 and later), 10.5 (For Mac OS X 10.5 and later)

Assembly: Monobjc.Foundation (Module: Monobjc.Foundation)