Friday, October 8, 2010

Regex for Alphabet

public static bool IsAlphabet(string temp)
{
bool isAlpha = true;
Regex regularExp = new Regex(@"^([a-zA-Z]{1})$");
if (!regularExp.IsMatch(temp))
{
isAlpha = false;
}
return isAlpha;
}

No comments:

Post a Comment