Skip to content

stateName

stateName(stateCode): string | null

Returns the English name of a state from its two-letter code. The lookup ignores ASCII letter case only. It does not trim spaces, and it does not change other characters.

string

A state code, such as EK.

string | null

The state’s name, or null for an unknown code.

stateName('EK'); // 'Ekiti'
stateName('fc'); // 'Federal Capital Territory'
stateName('XX'); // null

Unofficial. Not made or endorsed by NIPOST.