Javascript String unescapeEntities()

Description

Javascript String unescapeEntities()


String.prototype.unescapeEntities = function() {
 return this.replace(/&#([0-9]{1,4});/gi, function(match, numStr) {
  var num = parseInt(numStr, 10);
  return String.fromCharCode(num);
 });/*from  w ww  .  j a v a 2s .  c o  m*/
};



PreviousNext

Related