判断字符串是否有中文 用的是正则表达式 + UTF-8 /** * 测试是否有中文, 中文标点测试不出来 */ function testChinese(str:String):Boolean { return / .*[\u4e00 -\u 9fa5] + .*$ / .test(str); }