formatCreditCard

@JvmOverloads
fun String.formatCreditCard(separator: String = " ", separatorDigit: Int = 4): String

Format string as credit card number.

Example:

"1234567890123456".formatCreditCard(separator = "-") // 1234-5678-9012-3456
"1234567890123456".formatCreditCard() // 1234 5678 9012 3456

Since

1.1.0

Return

formatted credit card number.