-
Notifications
You must be signed in to change notification settings - Fork 33
Properties
Martijn Bodeman edited this page Nov 25, 2023
·
8 revisions
The Iban
type exposes several convenience properties to extract components of an IBAN.
IbanParser parser = new IbanParser(new IbanValidator());
Iban iban = parser.Parse("GB29NWBK60161331926819");
Console.WriteLine(iban.Country.TwoLetterISORegionName); // GB
Console.WriteLine(iban.Bban); // NWBK60161331926819
Console.WriteLine(iban.BankIdentifier); // NWBK
Console.WriteLine(iban.BranchIdentifier); // 601613
Note that
BankIdentifier
andBranchIdentifier
are not supported for all countries and registry providers, in which casenull
will be returned. Either identifier is guaranteed notnull
when the country specification defines positional information, which can can be looked up in theIIbanRegistry
.You can also access a country its registry information via the
iban.Country
property, for example:iban.Country.Branch.Position
.