stripTags
Removes HTML/XML tags from a string.
stripTags
Signature
typescript
function stripTags(str: string): stringParameters
str- The string to strip tags from
Returns
String with all HTML/XML tags removed.
Examples
typescript
import { stripTags } from 'strio'
stripTags('<p>Hello <strong>world</strong></p>')
// "Hello world"
stripTags('<div>Test</div>')
// "Test"Related Functions
- escapeHtml - Escape HTML characters
- collapseWhitespace - Collapse spaces
- stripPrefix - Remove prefix
- stripSuffix - Remove suffix