Java tutorial
//package com.java2s; public class Main { /** * Check if a string is empty (length == 0) * * @param string , to be checked * @return true if empty */ public static boolean isEmpty(String string) { if (string == null || string.trim().length() == 0) { return true; } return false; } }