Skip to content
skwasjer edited this page Nov 30, 2021 · 12 revisions

Iban instances can be compared for equality using ==, != or Equals.

Example

IIbanParser parser = new IbanParser(new IbanValidator());
Iban iban1 = parser.Parse("NL91ABNA0417164300");
Iban iban2 = parser.Parse(" NL91 ABNA 0417 1643 00 ");
Iban iban3 = parser.Parse("BE68 5390 0754 7034");
Debug.WriteLine(iban1 == iban2); // True
Debug.WriteLine(iban1.Equals(iban2)); // True
Debug.WriteLine(iban1 == iban3); // False
Debug.WriteLine(iban1 != iban3); // True

Hash code

The Iban type implements GetHashCode(), and thus can be used as a key for dictionaries.