using System;
using System.Collections.Generic;
using System.Text;
namespace TDRFactory
{
public class Util
{
//判断输入是否为double,不是则返回true
public static bool isNotDouble(string str)
{
bool flag = false;
if (str.StartsWith(".") || str.EndsWith("."))
{
flag = true;
}
else
{
for (int i = 0; i < str.Length; i++)
{
if (!(char.IsDigit(str,i) || str[i].Equals('.')))
{
flag = true;
break;
}
}
}
return flag;
}
}
}
判断输入的值是否为Double
最新推荐文章于 2021-02-16 18:59:03 发布