Does not contain a separator
NSString * str = @"hello";
NSMutableArray * arr = [NSMutableArray arrayWithCapacity:0];
// Traverse the string and traverse it by character. Each character will be passed out through the substring in the block parameter.
[str enumerateSubstringsInRange:NSMakeRange(0, str.length) options:NSStringEnumerationByComposedCharacterSequences usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) {
[arr addObject:substring];
}];
NSLog(@"arr = %@", arr);
Separator
NSArray *array = [str componentsSeparatedByString:@","];--separator
Convert array array to string
NSString *str = [array componentsJoinedByString:@","]; , separator
STRTOK provided by C ++ for string array segmentation, don't say, on the code: Output results:...
1, dynamic SQL method 2, the cycle interception method Reprinted at: https://www.jianshu.com/p/2825b4f9bd39...
We often encounter in their daily development will be divided in accordance with a specified string of characters. At this time, we tend to think of usestr.split(","), Obtained by processing...