Prüft auf deutsches Postleitzahlenformat.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | /*wird benoetigt fuer regularExpression*/ using System.Text.RegularExpressions; /*method validateZipCode*/ public bool validatePLZ(string PLZ) { string plzPattern = @"^(D-)?\d{5}$"; Regex re = new Regex(plzPattern); Match ma = re.Match(PLZ); if (ma.Success) return true; else return false; } |







