diff options
Diffstat (limited to 'Source/SPArrayAdditions.m')
-rw-r--r-- | Source/SPArrayAdditions.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/SPArrayAdditions.m b/Source/SPArrayAdditions.m index de7b8a3e..6dd9aa30 100644 --- a/Source/SPArrayAdditions.m +++ b/Source/SPArrayAdditions.m @@ -76,6 +76,25 @@ return result; } +- (NSString *)componentsJoinedByPeriodAndBacktickQuotedAndIgnoreFirst +{ + NSMutableString *result = [NSMutableString string]; + [result setString:@""]; + BOOL notFirst = NO; + for (NSString *component in self) + { + if ([result length]) + [result appendString: @"."]; + + if (notFirst) + [result appendString:[component backtickQuotedString]]; + + notFirst = YES; + } + return result; +} + + - (NSArray *)subarrayWithIndexes:(NSIndexSet *)indexes { NSMutableArray *subArray = [NSMutableArray arrayWithCapacity:[indexes count]]; |