Java tutorial
//package com.java2s; public class Main { public static boolean testEmpty(String str) { if ((str == null) || str.matches("^\\s*$")) { return true; } else { return false; } } }