Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
// Based upon:
#import <Foundation/Foundation.h>
@interface NSString (split)
@property (nonatomic, readonly) NSArray *split;
#import "NSString+split.h"
@implementation NSString (split)
- (NSArray *)split {
NSMutableArray *letterArray = [NSMutableArray array];
[self enumerateSubstringsInRange:NSMakeRange(0, self.length) options:(NSStringEnumerationByComposedCharacterSequences) usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
[letterArray addObject:substring];
return letterArray;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment