Write code to check if a string is Blank
//package com.book2s; public class Main { public static void main(String[] argv) { String str = "book2s.com"; System.out.println(isBlank(str)); }/*from w w w . j av a 2 s .c o m*/ public static boolean isBlank(String str) { int length; if ((str == null) || ((length = str.length()) == 0)) { return true; } for (int i = 0; i < length; i++) { if (!Character.isWhitespace(str.charAt(i))) { return false; } } return true; } }