CountryCode

Field: static readonly CountryCode Default

Returns the default country code(XX).


Method: ContryCode Parse(String)

Creates and returns the CountryCode object with the 2-digit country code of an ISO 3166-1 standard.

Parameter Name Description
countryCodeString 2-digit country code in string type. Example: TR

Error Type: ArgumentNullException (This error is thrown if the countryCodeString value is null or empty.)

Error Type: FormatException (This error is thrown if the countryCodeString value is not 2 digits and is not equal to any 2-digit country code in the ISO 3166-1 standard.)


Method: static List<CountryCode> GetAllCodes()

Returns all the country codes of the ISO 3166-1 standard in the type CountryCode. See for country codes list: Country Codes


Property: string Value

Returns 2 digits of country code information in string type.

    CountryCode.AF.ToString(); //"AF" returns

Property: string ThreeDigitCode

Returns 3-digit country code as a string type

    CountryCode.AF.ThreeDigitCode; //"AFG" returns.

Property: string Numeric

Returns numeric country code as a string type

    CountryCode.AF.Numeric; //"004" returns

Method: string ToString()

Returns 2-digit country code as a string type

    CountryCode.AF.ToString(); //"AF" returns.

Method: bool Equals(Object)

Returns true if the given object has the same value as the CountryCode object and the data, false otherwise.

Parameter Name Description
obj Object to be compared

Method: bool Equals(CountryCode)

Returns true if the given CountryCode object has the same value as the data, false otherwise.

Parameter Name Description
other The object of type CountryCode to be compared