mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
(-componentsJoinedByString:): Implemented method.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@313 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
381aa751fb
commit
226b70f947
1 changed files with 12 additions and 2 deletions
|
@ -198,8 +198,18 @@
|
|||
|
||||
- (NSString*) componentsJoinedByString: (NSString*)separator
|
||||
{
|
||||
[self notImplemented:_cmd];
|
||||
return 0;
|
||||
int i, c = [self count];
|
||||
id s = [NSMutableString stringWithCapacity:2]; /* arbitrary capacity */
|
||||
|
||||
if (!c)
|
||||
return s;
|
||||
[s appendString:[[self objectAtIndex:0] description]];
|
||||
for (i = 1; i < c; i++)
|
||||
{
|
||||
[s appendString:separator];
|
||||
[s appendString:[[self objectAtIndex:i] description]];
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue