is string Empty - Android java.lang

Android examples for java.lang:String Null or Empty

Description

is string Empty

Demo Code


public class Main{

    /**/*from  ww  w. jav a2 s.c  om*/
     * Returns true if the string is {@code null} or 0-length.
     * 
     * @param value target value
     * @return true if the string is {@code null} or 0-length.
     */
    public static boolean isEmpty(final String value) {
        return value == null || value.length() == 0;
    }

}

Related Tutorials