apache.commons.lang 包 StringUtils 的 isBank() 方法认知
2016-05-13 19:19
761 查看
今天在代码调试中 无意发现了 同事的代码 发现了 StringUtils isBank 方法 百度了 写个博客存储下知识
已前判断 Stirng 类型是否为空一般会用 isEmpty 方法
isEmpty 和 isBank 方法 最大的不同点 在于: isBank 能判断空格符 而isEmpty 不能
String string = " ";
System.out.println(StringUtils.isEmpty(string));
结果为 false
换成isBank
String string = " ";
System.out.println(StringUtils.isBlank(string));
true
已前判断 Stirng 类型是否为空一般会用 isEmpty 方法
isEmpty 和 isBank 方法 最大的不同点 在于: isBank 能判断空格符 而isEmpty 不能
String string = " ";
System.out.println(StringUtils.isEmpty(string));
结果为 false
换成isBank
String string = " ";
System.out.println(StringUtils.isBlank(string));
true
相关文章推荐
- mac开机启动原理--apache
- apache CXF wsdl2java工具的使用
- Ubuntu16.04安装LAMP环境
- Apache-Commons包作用说明
- Apache Thrift的简单使用
- Apache2.4.9本地访问正常但是在局域网或外网IP拒绝访问
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 2 of 2-byte
- linux下安装配置apache+nagios
- Ubuntu16.04 关闭apache/mysql/php的开机启动
- Apache2.4.18 + PHP7.0.4 环境安装
- CentOS 6.3下 源码包安装LAMP(Linux+Apache+Mysql+Php)环境
- Apache Flink源码解析之stream-windowfunction
- 15分钟了解Apache Phoenix(HBase的开源SQL引擎)
- 新一代大数据处理引擎 Apache Flink
- apache-activemq(四)
- apache-activemq(三)
- 深入理解Apache的mod_rewrite
- apache-activemq(二)
- apacheActiveMQ(一)
- at org.apache.hadoop.util.RunJar.main(RunJar.java:153)