getDisplayCreditNumberFormat static method
Implementation
static String getDisplayCreditNumberFormat(String input) {
// Non-Amex PANs are groups of 4, with a short tail. Up to 19 digits.
final digits = input.replaceAll(RegExp(r'\D'), '');
const max = 19;
final capped = digits.length > max ? digits.substring(0, max) : digits;
return _groupFours(capped);
}