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

isBlank()
String.prototype.isBlank = function() {
    if (this.trim().length == 0)
        return true;
    else
        return false;
};
Date.prototype.toLocalDate = function() {
    var localTime = this.getTime();
    var localOffset = this.getTimezoneOffset() * 60000;
...
isBlank()
String.prototype.isBlank = function() {
    if (this == undefined || this == "" || this == null || /^\s*$/.test(this)) {
        return true;
    return false;
};
isBlank()
String.prototype.isBlank = function()
  try
    var value = this.toString().trim();
    if (value == null) return true;
      if (value.length == 0)
        return true;
      else
...
isBlank(pattern)
String.prototype.isBlank = function(pattern) {
  return /^\s*$/.test(this);
};