Schweizer Postleitzahl validieren
/// <summary>
/// Determines whether the specified input is a Swiss zipcode
/// </summary>
/// <param name="canditate">The canditate.</param>
/// <returns>
/// <c>true</c> if [is german zipcode] [the specified canditate]; otherwise, <c>false</c>.
/// </returns>
static bool IsSwissZipcode(string canditate)
{
System.Text.RegularExpressions.Regex pattern = new System.Text.RegularExpressions.Regex(@"^[1-9][0-9]{3}$");
return pattern.IsMatch(canditate.Trim());
}
2 Kommentare zum Snippet