2024-09-03 17:34:40 +03:00
# unescape
2024-09-08 11:11:06 +03:00
Converts the HTML entities `&` , `<` , `>` , `"` , and `'` in `str` to their corresponding characters. It is the inverse of [`escape` ](./escape.md ).
2024-09-03 17:34:40 +03:00
## Signature
```typescript
function unescape(str: string): string;
```
### Parameters
- `str` (`string`): The string to unescape.
### Returns
(`string`): The unescaped string.
## Examples
```typescript
import { unescape } from 'es-toolkit/string';
unescape('This is a < div> element.'); // returns 'This is a < div > element.'
unescape('This is a " quote" '); // returns 'This is a "quote"'
unescape('This is a ' quote' '); // returns 'This is a 'quote''
unescape('This is a & symbol'); // returns 'This is a & symbol'
```