Java tutorial
//package com.java2s; public class Main { public static boolean isNullOrWhiteSpace(String str) { if (str == null || str.isEmpty()) { return true; } for (char c : str.toCharArray()) { if (!Character.isWhitespace(c)) { return false; } } return true; } }