Unescape HTML String by replace method - Node.js String

Node.js examples for String:HTML String

Description

Unescape HTML String by replace method

Demo Code


String.prototype.unescapeHTML = function() {
  return String(this).replace("&amp;", "&").replace("&lt;", "<").replace("&gt;", ">").replace('&quot;', '"').replace('&#39;', "'").replace('&#x2F;', "/");
}

Related Tutorials