StringUtils.isNumeric("")竟然返回true
来源:互联网 发布:中国武术是花架子知乎 编辑:程序博客网 时间:2024/05/17 04:53
* <pre> * 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 * </pre> * * @param str the String to check, may be null * @return <code>true</code> if only contains digits, and is non-null */ public static boolean isNumeric(String str) { if (str == null) { return false; } int sz = str.length(); for (int i = 0; i < sz; i++) { if (Character.isDigit(str.charAt(i)) == false) { return false; } } return true; }
https://issues.apache.org/jira/browse/LANG-428
- Type: Bug
- Status: Closed
- Priority: Minor
- Resolution: Fixed
- Affects Version/s: 2.3
- Fix Version/s: 3.0
- Component/s: lang.*
- Labels:None
3.0版本已经解决该问题
分类: JAVA
阅读全文
0 0
- StringUtils.isNumeric("")竟然返回true
- StringUtils.isNumeric使用
- ISNUMERIC
- onTouch返回true的含义
- imm.isActive()一直返回true
- StringUtils
- StringUtils
- StringUtils
- StringUtils
- StringUtils
- StringUtils
- StringUtils
- StringUtils
- StringUtils
- StringUtils
- StringUtils
- StringUtils
- StringUtils
- 安卓apk加密,几维安全帮你及时规避app潜在风险
- 在比较对象的时候为什么要重写equls()与hashCode()方法
- IMWeb提升营Day3
- Walle(瓦力)多渠道打包(含加固)-----------命令行
- 虚拟机网络工作模式
- StringUtils.isNumeric("")竟然返回true
- JDBC连接SqlServer集群
- mysql查询优化
- Android4.2系统辅助功能打开时,加载WebView导致空指针异常解决记录
- Bitmap的recycle问题
- RabbitMQ (四) 路由选择 (Routing)
- perl select 函数
- Spring--AOP-前置通知
- IGMP协议