Using nested if statements to check if string is Empty - Android java.lang

Android examples for java.lang:String Null or Empty

Description

Using nested if statements to check if string is Empty

Demo Code


public class Main{

    public static boolean isEmpty(String str) {
        if (str != null) {
            if (str.length() > 0) {
                return false;
            }//from   www  . j a  va 2  s .c om
        }
        return true;
    }

}

Related Tutorials