我需要替换 这里 定义的 unicode 字符
到目前为止我已经知道了,但它似乎删除了所有空间,包括标准空格键:
var str = "Hello this is a test of the site";
str= str.replace(/[ \u00A0\u1680\u180e\u2000-\u2009\u200a\u200b\u202f\u205f\u3000]/g,'')
结果 - Hellothisisatetofthesite
我只想删除字符串中 ‘test’ 和 ‘of’ 之间的 U+2003 unicode 字符。
原文由 user2025749 发布,翻译遵循 CC BY-SA 4.0 许可协议
删除您在模式中首先拥有的常规空间: