【代码笔记】iOS-竖排文字

一,代码。

【代码笔记】iOS-竖排文字
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view. NSString *str = @"你好啊";
NSMutableArray *arr = [[NSMutableArray alloc] init];
for (int i = 0; i<str.length ; i++) {
NSString *str1 = [str substringWithRange:NSMakeRange(i, 1)];
NSString *str2 = [str1 stringByAppendingString:@"\n"]; [arr addObject:str2];
}
NSString *str3;
for (int i = 0; i<arr.count - 1; i++) {
if (i == 0) {
str3 = [arr[i] stringByAppendingString:arr[i+1]];
}else{
str3 = [str3 stringByAppendingString:arr[i+1]];
}
}
NSLog(@"%@",str3); }
【代码笔记】iOS-竖排文字

二,输出。

2015-10-20 14:25:43.161 竖排文字[8130:197228] 你
 
 
上一篇:yii2源码学习笔记(十七)


下一篇:HDU 2289 Cup