NSString Documentation

SWIFT

func componentsSeparatedByString(_ separatorString) -> [String]

OBJECTIVE-C

- (NSArray<NSString *> *)componentsSeparatedByString:(NSString *)separator


Example

// token으로 문자열 자르기
NSString *list = @"1;2;3;4;5";
NSArray *listItems = [list componentsSeparatedByString:@";"];

// 결과값
// {@"1", @"2", @"3", @"4", @"5"}


+ Recent posts