Java tutorial
//package com.java2s; public class Main { /** * @param str * @return if string is null or its size is 0 or it is made by space, return * true, else return false. */ public static boolean isEmpty(String str) { return (str == null || str.trim().length() == 0 || str.equals("null") || str.trim().equals("")); } }