#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
NSString *string=@"2013 年 05 月 05 日";
NSRange strc=NSMakeRange(0, 4);
NSRange strc1=NSMakeRange(7, 2);
NSRange strc2=NSMakeRange(12, 2);
NSString *str1=[string substringWithRange:strc];
NSString *str2=[string substringWithRange:strc1];
NSString *str3=[string substringWithRange:strc2];
NSArray *arr=[NSArray arrayWithObjects:str1,str2,str3, nil];
NSString *str5=[arr componentsJoinedByString:@"-"];
NSLog(@"%@",str5);
}
return 0;
}