Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static boolean isEmpty3(CharSequence str) { return (isEmpty2(str) || "0".equals(str.toString().trim())); } public static boolean isEmpty2(CharSequence str) { return (isEmpty(str) || str.toString().trim().equalsIgnoreCase("null")); } public static boolean isEmpty(CharSequence str) { return (null == str || str.toString().length() == 0); } }