using System.Text.RegularExpressions; public static bool IsInt(string inString) { Regex regex = new Regex("^[0-9]*[1-9][0-9]*$"); return regex.IsMatch(inString.Trim()); }