Skip to content

unescape

Unescape HTML entities in a string.

Usage

js
import { unescape } from 'js-cool'

Signature

typescript
function unescape(string: string): string

Parameters

ParameterTypeDescription
stringstringThe string to unescape

Returns

string - The unescaped string.

Examples

js
unescape('&lt;div&gt;Hello&lt;/div&gt;') // '<div>Hello</div>'
unescape('a &amp; b') // 'a & b'
unescape('&quot;hello&quot;') // '"hello"'
  • escape - Escape HTML special characters

Released under the MIT License.