IBAN parsing library.
Add library as a dependency to Cargo.toml.
toml
...
[dependencies]
iban = "1"
...
Construct a Iban
type by using str::parse
, FromStr::from_str
, or Iban::parse
.
```rust use iban::Iban; let iban: Iban = "AA110011123Z5678" .parse() .unwraporelse(|err| { // This example panics, but you should handle the error cases properly. panic!("invalid iban: {err}"); });
let countrycode: &str = iban.countrycode(); let bban: iban::Bban = iban.bban();
let bankidentifier: Option<&str> = bban.bankidentifier(); ```