NodeJs判断字符串是否为空

判断字符串是否为空

var str = "";
if(str.trim()!==""){ 
console.log("非空"); 
}else{
console.log( "空"); 
}

猜你喜欢

转载自blog.csdn.net/qq_15623599/article/details/77529206
今日推荐