Java | org.apache.commons.lang3 package tool class StringUtils.isEmpty () and StringUtils.isBlank () difference

The main difference is that the empty string StringUtils.isBlankcan be included in the judgment of the empty string , returntrue

StringUtils.isEmpty()

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

StringUtils.isBlank()

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

Guess you like

Origin blog.csdn.net/y1534414425/article/details/108051912