Skip to content
skwas edited this page Dec 11, 2019 · 13 revisions

To convert an Iban type to a string, call the ToString(string format) method with either of 2 formats:

  • IbanNet.Iban.Formats.Flat (default)
  • IbanNet.Iban.Formats.Partitioned

Example

Iban iban = Iban.Parse("NL91 ABNA 0417 1643 00");
Debug.WriteLine(iban);                                    // NL91ABNA0417164300
Debug.WriteLine(iban.ToString(Iban.Formats.Flat));        // NL91ABNA0417164300
Debug.WriteLine(iban.ToString(Iban.Formats.Partitioned)); // NL91 ABNA 0417 1643 00

By convention, it is recommended to use the flat format when persisting an IBAN in a database, file or otherwise.