为了达到兼容 Mac 或者 windows 操作系统中 中文货币 "¥"的判断,使用 ascii 判断
function isCNYStr(cnyStr){ var isWindowCNY = /\\uffe5/.test(cnyStr); var isMacCNY = /\\u00A5/.test(cnyStr); if (isWindowCNY || isMacCNY) { return true } }
小驰chi ©著作权
文章标签 JavaScript 文章分类 Java 后端开发
为了达到兼容 Mac 或者 windows 操作系统中 中文货币 "¥"的判断,使用 ascii 判断
function isCNYStr(cnyStr){ var isWindowCNY = /\\uffe5/.test(cnyStr); var isMacCNY = /\\u00A5/.test(cnyStr); if (isWindowCNY || isMacCNY) { return true } }
Spring Boot中的HTTPS设置:一步步教程!
如何在 JavaScript 中定义枚举?
如何在 JavaScript 中实现睡眠功能?
获取当前日期和时间的时间戳或我们想要的JavaScript日期时间。
如何在 JavaScript 中实现单例?
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M