NumberUtils.isDigits("1") NumberUtils.isDigits("/")根据返回 true false 再确定是否转换即可 需要common包支持 转载于:https://www.cnblogs.com/lansefengmeng/p/7149259.html