[英]how to wrap a backslash as an array item with single or double quote in javascript
I have an array like below: '°', '=', '{', '}', '\\', '%', '©', '®', '™', '✓',
need to figure out how to wrapper the backslash() in the array.我有一个像下面这样的数组:
'°', '=', '{', '}', '\\', '%', '©', '®', '™', '✓',
需要计算了解如何包装数组中的反斜杠()。 currently it's regarded as error.目前它被视为错误。
Backslash is an escape token, so you can just escape it to be treated as a literal.反斜杠是一个转义标记,因此您可以将其转义以将其视为文字。
'\\\\'
您可以使用encodeURI("\\")
函数或直接用'\\\\'
转义它
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.