format

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

Formats a valid IMEI number to its canonical form.

Output: 15 consecutive digits with no separator. Example: "490 154 203 237 518""490154203237518".

No separator in output — ITU-T E.118 does not mandate a canonical display separator. Vendor display varies across manufacturers (groups of 2-3-4-6 on phone screens). Callers who want grouped display (e.g. "490-154-203-237518") must apply their own grouping.

Input is normalised (whitespace stripped) before formatting. This method is idempotent: format(format(x)) == format(x).

Return

Canonical 15-digit IMEI string with no separator.

Parameters

value

Raw IMEI string in any common input form.

Throws

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

Samples

check(IMEI.format("356938035643809") == "356938035643809")