WebLinuxStudy

导航

 

/**
* 判断字符串是否包含中文
*/
function checkStringIsChinese(str) {
  var pattern = new RegExp("[\u4E00-\u9FA5]+");
  if (pattern.test(str)) {
    return true;
  }
  return false;
}

 

posted on 2020-10-14 11:09  WebLinuxStudy  阅读(1400)  评论(0编辑  收藏  举报