Java tutorial
//package com.java2s; public class Main { /** * Checks if is empty. * * @param str the str * @return true, if is empty */ public static boolean isEmpty(String str) { return str == null || str.equalsIgnoreCase("null") || str.trim().length() == 0; } }