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; } } }