unescape source npm
_.unescape([string=''])
反向版 _.escape
。
这个方法转换 HTML 实体
&
, <
, >
, "
, '
, 以及 `
为对应的字符。
注意: 不会转换其他的 HTML 实体,需要转换可以使用类似 _he_ 的第三方库。
参数
- [string=''] (string)
要转换的字符串
返回值 (string)
返回转换后的字符串
示例
_.unescape('fred, barney, & pebbles');
// => 'fred, barney, & pebbles'