Java tutorial
//package com.java2s; public class Main { /** * A method to check whether a string is null or empty. * * @param String . * @return boolean true or false. */ public static boolean isNullOrEmpty(String s) { return s == null ? true : (s.trim().length() <= 0); } }