如何判断是否为数字字符串

7 阅读1分钟
       function isNumericString(str: any) {
          return /^[-+]?(\d+\.?\d*|\.\d+)([eE][-+]?\d+)?$/.test(str);
        }