mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +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
3d1c766353
commit
46cf45b928
1 changed files with 12 additions and 2 deletions
|
@ -198,8 +198,18 @@
|
||||||
|
|
||||||
- (NSString*) componentsJoinedByString: (NSString*)separator
|
- (NSString*) componentsJoinedByString: (NSString*)separator
|
||||||
{
|
{
|
||||||
[self notImplemented:_cmd];
|
int i, c = [self count];
|
||||||
return 0;
|
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…
Add table
Add a link
Reference in a new issue