mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
Added -stringByReplacingCharactersInRange:withString: (Mac OS 10.5 method)
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31776 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8209004750
commit
dfa04d7fb9
3 changed files with 22 additions and 0 deletions
|
@ -1786,6 +1786,7 @@ handle_printf_atsign (FILE *stream,
|
|||
range: searchRange];
|
||||
return [copy makeImmutableCopyOnFail: NO];
|
||||
}
|
||||
|
||||
- (NSString*)stringByReplacingOccurrencesOfString: (NSString*)replace
|
||||
withString: (NSString*)by
|
||||
{
|
||||
|
@ -1796,6 +1797,18 @@ handle_printf_atsign (FILE *stream,
|
|||
range: NSMakeRange(0, [self length])];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new string where the substring in the given range is replaced by
|
||||
* the passed string.
|
||||
*/
|
||||
- (NSString*) stringByReplacingCharactersInRange: (NSRange)aRange
|
||||
withString: (NSString*)by
|
||||
{
|
||||
id copy = [self mutableCopy];
|
||||
[copy replaceCharactersInRange: aRange withString: by];
|
||||
return [copy makeImmutableCopyOnFail: NO];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a substring of the receiver from character at the specified
|
||||
* index to the end of the string.<br />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue