Created
May 10, 2013 17:24
-
-
Save shuizhongyueming/5555939 to your computer and use it in GitHub Desktop.
JavaScript: Util checkNull
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* [checkNull 查看函数是否为空或者只有空格] | |
* @param {[string]} str [要验证的字符串] | |
* @return {[int]} [0,为空;1,不为空] | |
*/ | |
function checkNull(str){//,是,则return 0 | |
if(str.match(/^\s*$/g)){return 0;} | |
else{return 1;} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment