Javascript String add_slashes()

Description

Javascript String add_slashes()


String.prototype.add_slashes = function() {
  var string = this;
  string = string.replace(/\\/g,"\\\\");
  string = string.replace(/\'/g,"\\'");
  string = string.replace(/\"/g,"\\\"");
  return string;//  w w  w  .  j av  a 2s. com
}



PreviousNext

Related