IsBlank and isEmply, stringutilsisblank of StringUtils

Source: Internet
Author: User

IsBlank and isEmply, stringutilsisblank of StringUtils

1. public static boolean isEmpty (String str)

Determines whether a string is null. If it is null, the standard is str = null or str. length () = 0.

StringUtils. isEmpty (null) = true
 
StringUtils. isEmpty ("") = true
 
StringUtils. isEmpty ("") = false // note that non-empty spaces are processed in StringUtils.

 

2. public static boolean isBlank (String str)
 
Determines whether a string is null or has a length of 0 or is composed of whitespace.

StringUtils. isBlank (null) = true

StringUtils. isBlank ("") = true

StringUtils. isBlank ("") = true

StringUtils. isBlank ("\ t \ n \ f \ r") = true // For tabs, line breaks, page breaks, and carriage returns

StringUtils. isBlank () // both are blank characters
 
StringUtils. isBlank ("\ B") = false // "\ B" is the word boundary.

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.