如何在 JavaScript 中判断中文¥ 泰瑞_ 2021-01-25 157 阅读1分钟 为了达到兼容 Mac 或者 windows 操作系统中 中文货币 "¥"的判断,使用 ascii 判断 function isCNYStr(cnyStr){ var isWindowCNY = /\\uffe5/.test(cnyStr); var isMacCNY = /\\u00A5/.test(cnyStr); if (isWindowCNY || isMacCNY) { return true } }