format

fun format(value: String): String(source)

Formats a PAN to canonical form: 10-character uppercase, no separators.

Applies the same normalisation as validate before formatting. The Income Tax Department publishes no display separator convention — output is the raw uppercase string: e.g. "ABCPE1234F".

This method is idempotent: format(format(x)) == format(x).

Return

Canonical 10-character uppercase PAN string.

Parameters

value

Raw PAN string.

Throws

if value is not a valid PAN. The exception message includes the (truncated) input for diagnostics.

Samples

check(PAN.format("abcpe1234f") == "ABCPE1234F")