-
C#正则表达式判断数字
/// <summary>
/// 判断字符串是否为数字
/// </summary>
/// <param namee="value"></param>
/// <returns></returns>
public static bool IsInt(string value)
{
//命名空间using System.Text.RegularExpressions;
return Regex.IsMatch(value, @"^[0-9]*[1-9][0-9]*$");
}
/// 判断字符串是否为数字
/// </summary>
/// <param namee="value"></param>
/// <returns></returns>
public static bool IsInt(string value)
{
//命名空间using System.Text.RegularExpressions;
return Regex.IsMatch(value, @"^[0-9]*[1-9][0-9]*$");
}