标签:str sage har 正则 text 分享图片 技术分享 http val
实现效果:

知识运用:

代码实现:
private void button1_Click(object sender, EventArgs e)
{
if (IsValidate(textBox1.Text.ToString()))
MessageBox.Show("验证通过","提示:");
else
MessageBox.Show("验证失败", "提示:");
}
//方法定义
public bool IsValidate(string str_decimal) {
return System.Text.RegularExpressions.
Regex.IsMatch(str_decimal,@"^[0-9]+\.[0-9]{2}$");
}
标签:str sage har 正则 text 分享图片 技术分享 http val
原文地址:https://www.cnblogs.com/feiyucha/p/9978034.html