Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Category on NSArray for concatenating NSStrings.
@interface NSArray (StringUtilities)
- (NSString *)string;
@implementation NSArray (StringUtilities)
- (NSString *)string { return [self componentsJoinedByString:@""]; }
// Usage Example: NSString *test = @[ @"This", @" is", @" a", @" test." ].string;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment