【发布时间】:2018-07-05 14:04:14
【问题描述】:
我需要发出“h”、“e”、“l”、“l”、“o”,但它仍然是“hello”。
NSString* s = @"hello";
NSArray* arr = [s componentsSeparatedByString:@""];
【问题讨论】:
-
分隔符不能为空。根据本指南,您必须迭代字符串并在每个索引处创建一个新字符串:idev101.com/code/Objective-C/Strings/split.html
标签: ios objective-c