Skip to content

Instantly share code, notes, and snippets.

@jmenter
Last active December 21, 2015 14:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmenter/6323518 to your computer and use it in GitHub Desktop.
Save jmenter/6323518 to your computer and use it in GitHub Desktop.
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