Skip to content

Instantly share code, notes, and snippets.

@jamiegs
jamiegs / gist:5391961
Created April 15, 2013 22:53
A java implementation of c#'s IsNullOrWhitespace
public static boolean isNullOrWhitespace(String s) {
if (s == null)
return true;
for (int i = 0; i < s.length(); i++) {
if (!Character.isWhitespace(s.charAt(i))) {
return false;
}
}
return true;
}