String str = "-1"; StringUtils.isNumeric(str) 返回的是false
StringUtils.isNumeric()方法在判斷字符串是否是整數的時候,實現完全沒有考慮到 - + 前綴的問題。
例如:【以下的一些特殊例子】
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 //小數 StringUtils.isNumeric("-3") = false //負數