zurück zur Aufgabe: String Übungen: MonthAsString
public class Datum { String lsMonth[] = new String[13]; public Datum() { lsMonth[0] = ""; lsMonth[1] = " Januar "; lsMonth[2] = " Februar "; lsMonth[3] = " März "; lsMonth[4] = " April "; lsMonth[5] = " Mai "; lsMonth[6] = " Juni "; lsMonth[7] = " Juli "; lsMonth[8] = " August "; lsMonth[9] = " Septemper "; lsMonth[10] = " Oktober "; lsMonth[11] = " November "; lsMonth[12] = " Dezember"; } private String getDay(String str) { String strDay = str.substring(0, 2); if (strDay.startsWith("0")) return strDay.substring(1); return strDay; } private String getMonth(String str) { String strMonat = str.substring(3, 5); int iMonat = Integer.valueOf(strMonat); return lsMonth[iMonat]; } private String getYear(String str) { return str.substring(6, 10); } public String monthAsString(String strDatum) { String d = getDay(strDatum); String m = getMonth(strDatum); String y = getYear(strDatum); return d + "." + m + y; } }