Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

isblank vs isempty

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

isblank vs isempty

public class Main 
{
    public static void main(String[] args) 
    {
        System.out.println( "ABC".isBlank() );      //false
        System.out.println( "  ".isBlank() );       //true
 
        System.out.println( "ABC".isEmpty() );      //false
        System.out.println( "  ".isEmpty() );       //false
    }
}
Comment

isblank vs isempty

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

isempty and isblank

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

isblank vs isempty


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

Comment

isblank or isempty

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

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

PREVIOUS NEXT
Code Example
Java :: how to check if a char is a letter java 
Java :: loop through keys only in hashmap java 
Java :: java set label color 
Java :: no main manifest attribute java 
Java :: navigate from one fragment to another android 
Java :: localdate add months in java 
Java :: json date format for localdate java 
Java :: min of an array java 
Java :: what is import java.io.*? 
Java :: dagger dependency maven dependency 
Java :: javadoc link to class 
Java :: android hide system bar programmatically 
Java :: What is null mean in java 
Java :: specify decimal places java 
Java :: isinstance java 
Java :: java sort list 
Java :: how to remove spaces from an array in java 
Java :: list set value at index java 
Java :: print * pattern in java 
Java :: Loop Structure in Java 
Java :: how to access variable from another class in java 
Java :: java random primary key 
Java :: jframe visible 
Java :: bufferedinputstream to byte array 
Java :: how to end a program in an if statement java 
Java :: random java 
Java :: java how to cast int to String 
Java :: java observer pattern 
Java :: how to get int from string java 
Java :: string to byte array java 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =