NSString *string = @"这是一个测试的字符串"; NSString *temp = nil;
for (int i = 0; i < [string length]; i ++) {
temp = [string substringWithRange:NSMakeRange(i, 1)];
NSLog(@"第%d个字是:%@",i,temp);
}
复制代码
NSString *string = @"这是一个测试的字符串"; NSString *temp = nil;
for (int i = 0; i < [string length]; i ++) {
temp = [string substringWithRange:NSMakeRange(i, 1)];
NSLog(@"第%d个字是:%@",i,temp);
}
复制代码
转载于:https://juejin.im/post/5a30e50ff265da43231af7aa