Last active
August 29, 2015 14:23
-
-
Save rwenz3l/8a7a72bdce824aa24ed2 to your computer and use it in GitHub Desktop.
Convert IBAN Landeskennung to Zahl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int LandeskennungToZahl(String Landeskennung){ | |
// Beispiel Landeskennung = DE | |
// return Zahl = 1314 | |
String alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
String LandesZahl = ""; | |
for(char b : Landeskennung.toCharArray()) { | |
int n = 10; | |
for(char a : alphabet.toCharArray()) { | |
String buchstabe = String.valueOf(n); | |
System.out.println("Ist " + b + " = " + a); | |
if (a == b) { | |
System.out.println("Ja! --> Zahl = " + n); | |
LandesZahl = LandesZahl + buchstabe; | |
break; | |
} | |
n = n+1; | |
} | |
} | |
int LandesZahlReturn = Integer.parseInt(LandesZahl); | |
return LandesZahlReturn; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment