/// <summary> /// Get the individual's acount number. /// </summary> /// <param name="format">How many characters are used for the Issuer, either 8 (Long) or 6 (Short)</param> /// <returns>The part of the credit card denoting the individual account number</returns> /// <exception cref="ArgumentOutOfRangeException">Invalid enum value argument (0)</exception> public string GetIndividualAccountNumber(CreditCardIssuerFormat format) { if (format == 0) { throw new ArgumentOutOfRangeException(nameof(format)); } if (string.IsNullOrEmpty(_value)) { return(_value); } return(_value.Substring((int)format, _value.Length - (int)format - 1)); }
/// <summary> /// Get the issuer based on the given format. /// </summary> /// <param name="format">Either Long (8) or Short (6)</param> /// <returns>The part of the credit card denoting the issuer</returns> /// <exception cref="ArgumentOutOfRangeException">Invalid enum value argument (0)</exception> public string GetIssuerIdentificationNumber(CreditCardIssuerFormat format) { if (format == 0) { throw new ArgumentOutOfRangeException(nameof(format)); } if (string.IsNullOrEmpty(_value)) { return(_value); } return(_value.Substring(0, (int)format)); }