C# 判断一字符串是否为合法正整数(正则表达式)


        /// 
        /// Used for verifying whether a string is a legal integer
        /// 
        /// the string for verifying
        /// 
        protected bool IsInteger(string value)
        {
            string pattern = @"^[0-9]*[1-9][0-9]*$";
            return Regex.IsMatch(value, pattern);
        }

你可能感兴趣的:(C#)