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

相关文章:

  • 2021-08-18
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-21
  • 2021-12-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-27
  • 2021-12-21
相关资源
相似解决方案