if (myString == null || myString.equals("")) // check if string is not null or empty if(str != null && !str.isEmpty())