殷眼疾

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
isEmpty  判断某字符串是否为空,为空的标准是 str==null或 str.length()==0 

   StringUtils.isEmpty(null) = true 
  StringUtils.isEmpty("") = true 
  StringUtils.isEmpty(" ") = false
  StringUtils.isEmpty("   ") = false 
  StringUtils.isEmpty("bob") = false 
  StringUtils.isEmpty(" bob ") = false

isBlank 判断某字符串是否为空或长度为0或由空白符(whitespace)构成 StringUtils.isBlank(null) = true   StringUtils.isBlank("") = true   StringUtils.isBlank(" ") = true   StringUtils.isBlank(" ") = true   StringUtils.isBlank("\t \n \f \r") = true //对于制表符、换行符、换页符和回车符   StringUtils.isBlank("\b") = false   StringUtils.isBlank("bob") = false   StringUtils.isBlank(" bob ") = false

 

posted on 2018-05-26 09:56  殷眼疾  阅读(101)  评论(0)    收藏  举报