Javascript String blank()
String.prototype.blank = function() { return /^\s*$/.test(this); };
String.prototype.blank = function() { return !(this.replace(/\s+/g, "").length) }
String.prototype.blank = function(){ return this.length === 0 || this.indexOf(" ") === 0 && this.length ===1; };
String.prototype.blank = function(){ //return (this === " " || this === ""); var that = this.split(""); return that.every(function(elem){ return elem === " "; }) || this === ""; }; //console.log(" ".blank());
String.prototype.blank = function () { return !(this. split(""). some(function (a) { return a !== " "; }));//from w w w .ja va2 s . c o m };
String.prototype.blank = function() { return this.replace(/\s+/g, '').length == 0 ? true : false; };