首页 > 代码库 > ios将银行卡号格式化

ios将银行卡号格式化

ios将银行卡号格式化

by 伍雪颖

- (NSString *)formatCardNumber:(NSString *)cardNum {
    NSNumber *number = @([cardNum longLongValue]);
    NSNumberFormatter *formatter = [NSNumberFormatter new];
    [formatter setUsesGroupingSeparator:YES];
    [formatter setGroupingSize:4];
    [formatter setGroupingSeparator:@" "];
    return [formatter stringFromNumber:number];
}


ios将银行卡号格式化