首页 > 其他 > 详细

验证是否是数字

时间:2019-08-22 12:49:28      阅读:85      评论:0      收藏:0      [点我收藏+]

//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*$");
}
public static bool IsUnsign(string value)
{
return Regex.IsMatch(value, @"^\d*[.]?\d*$");
}

public static bool isTel(string strInput)
{
return Regex.IsMatch(strInput, @"\d{3}-\d{8}|\d{4}-\d{7}");
}

验证是否是数字

原文:https://www.cnblogs.com/missheyo/p/11393268.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!