标签:ar io os sp for on bs ad tt
-(NSString *)formatterBankCardNum:(NSString *)string
{
NSString *tempStr=string;
NSInteger size =(tempStr.length / 4);
NSMutableArray *tmpStrArr = [[NSMutableArray alloc] init];
for (int n = 0;n < size; n++)
{
[tmpStrArr addObject:[tempStr substringWithRange:NSMakeRange(n*4, 4)]];
}
[tmpStrArr addObject:[tempStr substringWithRange:NSMakeRange(size*4, (tempStr.length % 4))]];
tempStr = [tmpStrArr componentsJoinedByString:@" "];
return tempStr;
}
标签:ar io os sp for on bs ad tt
原文地址:http://www.cnblogs.com/thbbsky/p/4169822.html