Java tutorial
//package com.java2s; //License from project: Apache License public class Main { /** * Checks if a String is whitespace, empty ("") or null. */ public static boolean isBlank(String string) { if (string == null) { return true; } return string.isEmpty() || " ".equals(string); } }