码迷,mamicode.com
首页 > Web开发 > 详细

js 验证字符串是否全为中文

时间:2018-02-07 15:03:01      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:bsp   body   class   return   col   false   ret   color   fun   

js 验证字符串是否全为中文:

function isChinese(str) {
    var reg = /^[\u4E00-\u9FA5]+$/;
    if(reg.test(str)){
        return true;
    }else{
        return false;
    }
}

 

js 验证字符串是否全为中文

标签:bsp   body   class   return   col   false   ret   color   fun   

原文地址:https://www.cnblogs.com/wxdblog/p/8425604.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!