Skip to content

Instantly share code, notes, and snippets.

@JumboLove
Created June 17, 2013 14:04
Show Gist options
  • Select an option

  • Save JumboLove/5797105 to your computer and use it in GitHub Desktop.

Select an option

Save JumboLove/5797105 to your computer and use it in GitHub Desktop.
Remove HTML from a string
function getShortDescription(product : Product) {
var description : String = product.getLongDescription().toString();
var htmlTest : RegExp = new RegExp("(<([^>]+)>)", "ig");
description = description.replace(htmlTest, "");
return description;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment