NodeJs判断字符串是否为空

来源:互联网 发布:高中毕业学java 编辑:程序博客网 时间:2024/06/18 06:11

判断字符串是否为空

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