//Microsoft Public License (Ms-PL)
//http://c4fdevkit.codeplex.com/license
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
namespace C4F.DevKit.WebServices
{
///
/// Provides useful methods like conversion methods.
///
public static class Utility
{
///
/// Validates the zip code
///
/// Zip code
/// True if zip code is valid
public static bool ValidateZipCode(string zipCode)
{
if (String.IsNullOrEmpty(zipCode))
return false;
return Regex.IsMatch(zipCode, "(^[0-9]{5}$)|(^[0-9]{5}-[0-9]{4}$)");
}
}
}