Create a gist now

Instantly share code, notes, and snippets.

Category on NSArray for concatenating NSStrings.
@interface NSArray (StringUtilities)
- (NSString *)string;
@end
@implementation NSArray (StringUtilities)
- (NSString *)string { return [self componentsJoinedByString:@""]; }
@end
// 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