public static bool IsNumber(string strNumber) { Regex regex = new Regex("[^0-9]"); return !regex.IsMatch(strNumber); }