mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 20:26:42 +00:00
Added a couple of convenience methods on NSString (OS X 10.5 compatibility).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@29810 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3a49540942
commit
08c1acb850
2 changed files with 28 additions and 0 deletions
|
@ -1614,6 +1614,28 @@ handle_printf_atsign (FILE *stream,
|
|||
return array;
|
||||
}
|
||||
|
||||
- (NSString*)stringByReplacingOccurrencesOfString: (NSString*)replace
|
||||
withString: (NSString*)by
|
||||
options: (NSStringCompareOptions)opts
|
||||
range: (NSRange)searchRange
|
||||
{
|
||||
id copy = [self mutableCopy];
|
||||
[copy replaceOccurrencesOfString: replace
|
||||
withString: by
|
||||
options: opts
|
||||
range: searchRange];
|
||||
return [copy makeImmutableCopyOnFail: NO];
|
||||
}
|
||||
- (NSString*)stringByReplacingOccurrencesOfString: (NSString*)replace
|
||||
withString: (NSString*)by
|
||||
{
|
||||
return [self
|
||||
stringByReplacingOccurrencesOfString: replace
|
||||
withString: by
|
||||
options: 0
|
||||
range: NSMakeRange(0, [self length])];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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