Global.String.prototype.unwrap (removeTags, replacement)
replace all linebreaks and optionally all w/br tags

  • Parameter Boolean:
    flag indicating if html tags should be replaced
  • Parameter String:
    replacement for the linebreaks / html tags
  • Returns
    String the unwrapped string
Sourcecode in /home/hannes/helma/modules/core/String.js:
425:   String.prototype.unwrap = function(removeTags, replacement) {
426:       if (replacement == null)
427:           replacement = String.NULL;
428:       var str = this.replace(/[\n|\r]/g, replacement);
429:       if (removeTags)
430:           str = str.replace(/<[w]?br *\/?>/g, replacement);
431:       return str;    
432:   }