【发布时间】:2018-02-13 08:17:49
【问题描述】:
我正在编写一个读取文本文件并处理其内容的 JS 脚本。
我需要检测输入中' 和\' 之间的区别。
有什么办法可以做到这一点吗?
注意:
> `'` === `\'`
true
> `'`.length === `\'`.length
true
【问题讨论】:
-
detect the difference between ' and \'是什么意思? -
假设,我需要计算普通单引号与转义单引号的数量。
标签: javascript string escaping