Remove WhiteSpace from String - Node.js String

Node.js examples for String:String Value

Description

Remove WhiteSpace from String

Demo Code


String.prototype.removeWhiteSpace = function() {
  return this.replace(/\s/g, "");
};
var namespace = window.namespace ||
function(name) {
  var parts = name.split(".");
  var parent = window;

  for(var i = 0, len = parts.length; i < len; ++i) {
    if( typeof (parent[parts[i]]) === "undefined") {
      parent[parts[i]] = {};//from   w w w  .  j  a v  a  2  s .co  m
    }
    parent = parent[parts[i]];
  }
}

Related Tutorials