private CountryCode(string countryName, string countryISOCode) : this()
 {
     _countryIsoCode  = new CountryISOCode();
     _countryDialCode = 0;
     CountryName      = countryName;
     CountryISOCode   = new CountryISOCode(countryISOCode);
 }
        public string GetPhoneExample()
        {
            if (CountryISOCode == null || !CountryISOCode.Code.HasValueTrimmed())
            {
                CountryISOCode = new CountryISOCode("CA");
            }

            var phoneNumberExample     = libphonenumber.PhoneNumberUtil.Instance.GetExampleNumber(CountryISOCode.Code);
            var phoneNumberExampleText = phoneNumberExample.Format(libphonenumber.PhoneNumberUtil.PhoneNumberFormat.E164);

            return(phoneNumberExampleText.Replace("+" + CountryDialCode, string.Empty));
        }
        public static CountryCode GetCountryCodeByCountry(CountryISOCode country)
        {
            var index = GetCountryCodeIndexByCountryISOCode(country);

            return(GetCountryCodeByIndex(index));
        }
 public static int GetCountryCodeIndexByCountryISOCode(CountryISOCode countryISOCode)
 {
     return(countryISOCode != null ? GetCountryCodeIndexByCountryISOCode(countryISOCode.Code) : -1);
 }