mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +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
|
@ -1,3 +1,10 @@
|
|||
2010-12-25 Quentin Mathe <quentin.mathe@gmail.com>
|
||||
|
||||
* Headers/Foundation/NSString.h:
|
||||
* Source/NSString.m:
|
||||
Added -stringByReplacingCharactersInRange:withString: (Mac OS 10.5
|
||||
method).
|
||||
|
||||
2010-12-25 12:13-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Tools/pl2link.m: Changes to better integrate with the GNOME
|
||||
|
|
|
@ -314,6 +314,8 @@ typedef NSUInteger NSStringEncodingConversionOptions;
|
|||
range: (NSRange)searchRange;
|
||||
- (NSString*)stringByReplacingOccurrencesOfString: (NSString*)replace
|
||||
withString: (NSString*)by;
|
||||
- (NSString*) stringByReplacingCharactersInRange: (NSRange)aRange
|
||||
withString: (NSString*)by;
|
||||
#endif
|
||||
- (id) initWithCharactersNoCopy: (unichar*)chars
|
||||
length: (NSUInteger)length
|
||||
|
|
|
@ -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…
Reference in a new issue