在editbox输入一串字符 如何检测输入的字符是否有中文呢

想要 通过editbox 的 return回调检测下输入的字符串中是否有中文,应该怎么做,有相应的接口吗

具体调用的接口参考
https://docs.cocos.com/creator/manual/zh/components/editbox.html?h=editbox
范例
搜索官方范例合集的editbox场景。
通过正则表达式作为判断条件进行判断是否中文字符。

// 判断是不是中文
function isChinese(char) { 
      var reCh = /[u00-uff]/;
    return !reCh.test(char);
}
2赞