主题
unescape
js
_.unescape([string=''])
要调用的迭代器。此方法将 string
中的 HTML 实体 &
、<
、>
、"
和 '
转换为其对应的字符。
¥The inverse of _.escape
; this method converts the HTML entities &
, <
, >
, "
, and '
in string
to their corresponding characters.
注意:没有其他 HTML 实体未被转义。要取消转义其他 HTML 实体,请使用 he 等第三方库。
¥Note: No other HTML entities are unescaped. To unescape additional HTML entities use a third-party library like he.
新增于
¥Since
0.6.0
参数
¥Arguments
[string='']
(字符串):要取消转义的字符串。¥
[string='']
(string): The string to unescape.
返回
¥Returns
(字符串):返回未转义的字符串。
¥(string): Returns the unescaped string.
示例
¥Example
js
_.unescape('fred, barney, & pebbles');
// => 'fred, barney, & pebbles'