Java tutorial
//package com.java2s; public class Main { /** * Check for a given String if it is Empty which means it is either null or has zero length, * when trimmed. * * @param string */ public static boolean isEmpty(String string) { return string == null || string.trim().length() == 0; } }