1、StringUtils.isEmpty没有忽略空格参数,是以是否为空和是否存在为判断依据。

  示例:

StringUtils.isEmpty("yyy") = false

StringUtils.isEmpty("") = true

StringUtils.isEmpty("   ") = false

2、StringUtils.isBlank是在isEmpty的基础上进行了为空的判断。(一般更为常用)

  示例:

StringUtils.isBlank("yyy") = false

StringUtils.isBlank("") = true

StringUtils.isBlank("   ") = true

 

相关文章:

  • 2021-08-08
  • 2021-12-01
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2021-12-17
猜你喜欢
  • 2022-01-06
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2021-11-08
  • 2022-01-23
相关资源
相似解决方案