Nodejs Utililty Methods String Empty Check

List of utility methods to do String Empty Check

Description

The list of methods to do String Empty Check are organized into topic(s).

Method

isEmpty()
String.prototype.isEmpty = function() {
    return this == null || this == '';
};
RegExp.escape = function(val) {
    return val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
};
isEmpty()
String.prototype.isEmpty = function() { 
  return (!this.length) 
isEmpty()
String.prototype.isEmpty = function() {
  return this.toString().trim() == "";
};
isEmpty()
String.prototype.isEmpty = function() {
  return (!this || 0 === this.length);
};
isEmpty()
String.prototype.isEmpty = function() {
  return (this == '');
};
isEmpty()
String.prototype.isEmpty = function () {
  "use strict";
  return (this.length === 0 || !this.trim());
};
isEmpty()
String.prototype.isEmpty=function(){
  return this.trim()=="";
};
isEmpty()
String.prototype.isEmpty = function () {
  return (!this || this == "[object Null]" || this == "" || this == "undefined");
isEmpty()
String.prototype.isEmpty = function() {
  return this.trim() === "";
isEmpty()
String.prototype.isEmpty = function(){
    return (this === null || this === '');
};