zoukankan      html  css  js  c++  java
  • Java lang3的 StringUtils.isNumeric(str)不能识别负数和小数

    Java lang3的 StringUtils.isNumeric(str)不能识别负数和小数。

    1.  
      StringUtils.isNumeric(null) = false
    2.  
      * StringUtils.isNumeric("") = false
    3.  
      * StringUtils.isNumeric(" ") = false
    4.  
      * StringUtils.isNumeric("123") = true
    5.  
      * StringUtils.isNumeric("u0967u0968u0969") = true
    6.  
      * StringUtils.isNumeric("12 3") = false
    7.  
      * StringUtils.isNumeric("ab2c") = false
    8.  
      * StringUtils.isNumeric("12-3") = false
    9.  
      * StringUtils.isNumeric("12.3") = false
    10.  
      * StringUtils.isNumeric("-123") = false
    11.  
      * StringUtils.isNumeric("+123") = false

    如果想判断各种数字类型,用

    NumberUtils.isCreatable(str)
  • 相关阅读:
    Redis 分布式锁
    Angular VS Blzaor
    Chorme 跨域的快捷解决
    旋转3角形
    .Netcore AD 操作
    .Netcore 2.2 和3.1 的模板
    Command3
    CSS Selector
    弹性盒子
    Label_strange_labels
  • 原文地址:https://www.cnblogs.com/marxtsui/p/14419790.html
Copyright © 2011-2022 走看看