使用StringUtils.isNumeric(String str) 判断string是否为数字

StringUtils.isNumeric(null)   = false
StringUtils.isNumeric("")     = true
StringUtils.isNumeric("  ")   = false
StringUtils.isNumeric("123")  = true
StringUtils.isNumeric("12 3") = false
StringUtils.isNumeric("ab2c") = false
StringUtils.isNumeric("12-3") = false
StringUtils.isNumeric("12.3") = false

  

posted @ 2020-09-08 21:50  Roy-Xin  阅读(1396)  评论(0编辑  收藏  举报