Skip to content

Instantly share code, notes, and snippets.

function removeTags(str) {
if (str === null || str === "") return false;
else str = str.toString();
return str
.replace(/(<([^>]+)>)/gi, "")
.replaceAll("[\r\n]+", "\n")
.replace(/\s\s+/g, " ")
.trim();
}

Keybase proof

I hereby claim:

  • I am nicktobolski on github.
  • I am tobo (https://keybase.io/tobo) on keybase.
  • I have a public key ASD4nI2k0PoJtEXT4-9S28rFQlEFSytqICN8UbklIoZnWgo

To claim this, I am signing this object: