The difference between IsEmpty and Isblank

Source: Internet
Author: User

IsEmpty Determines whether a string is empty, the standard for null is str== null 或 str.length()== 0

Stringutils.isempty ( null ) =  true

  StringUtils.isEmpty( "" ) =  true   StringUtils.isEmpty( " " ) =  false //注意在 StringUtils 中空格作非空处理     StringUtils.isEmpty( "   " ) =  false   StringUtils.isEmpty( "bob" ) =  false   StringUtils.isEmpty( " bob " ) =  false

IsBlank Determines whether a string is empty or has a length of0或由空白符(whitespace) 构成 

   StringUtils.isBlank(null) = true 

  StringUtils.isBlank( "" ) =  true   StringUtils.isBlank( " " ) =  true   StringUtils.isBlank( "        " ) =  true   StringUtils.isBlank( "\t \n \f \r" ) =  true //对于制表符、换行符、换页符和回车符     StringUtils.isBlank()    //均识为空白符     StringUtils.isBlank( "\b" ) =  false //"\b"为单词边界符     StringUtils.isBlank( "bob" ) =  false   StringUtils.isBlank( " bob " ) =  false

The difference between IsEmpty and Isblank

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.