C# 判断字符串是否数值

来源:互联网 发布:mysql导入数据 编辑:程序博客网 时间:2024/05/06 01:20

using System.Text.RegularExpressions;


        public static bool isNumeric(string value) //是否数字带小数点的        {            return Regex.IsMatch(value, @"^[+-]?\d*[.]?\d*$");        }        public static bool isInt(string value)//是否整型数字        {            return Regex.IsMatch(value, @"^[+-]?\d*$");        }


0 0