Javascript String isNullOrWhitespace(str)
/**//ww w. j a v a 2s . c o m * Checks if the string is empty, whitespace or null * * str: String to check */ String.isNullOrWhitespace = function(str) { if (str === undefined || str === null) { return true; } return str.toString().isNullOrWhitespace(); }