StringUtils.equals() 用法

  /*1. 比较两个字符串是否相等,如果两个均为null,则也认为相等*/
 
  StringUtils.equals("", "");   //结果是true
 
  StringUtils.equals(null, null);  //结果是true
 
  StringUtils.equals(null, "");  //结果是false
 
  StringUtils.equals("",null);  //结果是false
 
  StringUtils.equals(null,"");  //结果是false
 
  StringUtils.equalsIgnoreCase("ss", "Ss");  //不区分大小写--结果是true

 

if (null instanceof String) {
System.out.println("aaaaa");
} else {
System.out.println("bbbb");

}
posted @ 2020-05-18 17:20  那些年的代码  阅读(3638)  评论(0编辑  收藏  举报