c#判断字符串是否为空
string str="";
if (string.IsNullOrEmpty(str)){//高效简洁
//为空
}
js判断字符串是否为空
var str=""
//这是我最喜欢用的判空的方法
if(!str){ // "",null,undefined,NaN
//为空
}
if(!$.trim(str)){ // "",null,undefined
//为空
}
c#判断字符串是否为空
string str="";
if (string.IsNullOrEmpty(str)){//高效简洁
//为空
}
js判断字符串是否为空
var str=""
//这是我最喜欢用的判空的方法
if(!str){ // "",null,undefined,NaN
//为空
}
if(!$.trim(str)){ // "",null,undefined
//为空
}