Skip to content

@berikv /NSString+split.h
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
NSString+split
// Based upon: http://stackoverflow.com/a/13839284/439096
#import <Foundation/Foundation.h>
@interface NSString (split)
@property (nonatomic, readonly) NSArray *split;
@end
#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;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.