@Test public void testIsBlank() throws Exception { Assert.assertFalse(StringTools.isBlank(" a a ")); Assert.assertFalse(StringTools.isBlank("a a")); Assert.assertFalse(StringTools.isBlank(" a ")); Assert.assertFalse(StringTools.isBlank("a")); Assert.assertTrue(StringTools.isBlank(" ")); Assert.assertTrue(StringTools.isBlank(" ")); Assert.assertTrue(StringTools.isBlank("")); Assert.assertTrue(StringTools.isBlank(null)); }
public static boolean isBlank(CharSequence sourceSequence) { int sequenceLength; if (sourceSequence == null || (sequenceLength = sourceSequence.length()) == 0) { return true; } for (int i = 0; i < sequenceLength; i++) { if ((Character.isWhitespace(sourceSequence.charAt(i)) == false)) { return false; } } return true; }
StringTools { public static boolean isBlank(CharSequence sourceSequence) { int sequenceLength; if (sourceSequence == null || (sequenceLength = sourceSequence.length()) == 0) { return true; } for (int i = 0; i < sequenceLength; i++) { if ((Character.isWhitespace(sourceSequence.charAt(i)) == false)) { return false; } } return true; } }
StringTools { public static boolean isBlank(CharSequence sourceSequence) { int sequenceLength; if (sourceSequence == null || (sequenceLength = sourceSequence.length()) == 0) { return true; } for (int i = 0; i < sequenceLength; i++) { if ((Character.isWhitespace(sourceSequence.charAt(i)) == false)) { return false; } } return true; }  }
StringTools { public static boolean isBlank(CharSequence sourceSequence) { int sequenceLength; if (sourceSequence == null || (sequenceLength = sourceSequence.length()) == 0) { return true; } for (int i = 0; i < sequenceLength; i++) { if ((Character.isWhitespace(sourceSequence.charAt(i)) == false)) { return false; } } return true; }  static int countMatches(CharSequence sourceSequence, CharSequence subSequence); static boolean isNotBlank(CharSequence sourceSequence); static boolean isBlank(CharSequence sourceSequence); static boolean isEmpty(CharSequence sourceSequence); }
StringTools { public static boolean isBlank(CharSequence sourceSequence) { int sequenceLength; if (sourceSequence == null || (sequenceLength = sourceSequence.length()) == 0) { return true; } for (int i = 0; i < sequenceLength; i++) { if ((Character.isWhitespace(sourceSequence.charAt(i)) == false)) { return false; } } return true; }  static int countMatches(CharSequence sourceSequence, CharSequence subSequence); static boolean isNotBlank(CharSequence sourceSequence); static boolean isBlank(CharSequence sourceSequence); static boolean isEmpty(CharSequence sourceSequence);  }