#include<iostream> #include<string> using namespace std; int check(string a,string b,string c) { int lena=a.length(); int lenb=b.length(); int lenc=c.length(); ; if(a=="") { ; else if(b!=""&&c!="") { ;i<…
最近发现使用 -z 和 -n 来判断字符串判空,或不空时,很不靠谱. 使用下面的方法最可靠: if [ "x${value}" == "x" ] #为空 then #为空处理 fi if [ "x${value}" != "x" ] #不为空 then #不为空处理 fi 转自 Shell脚本中字符串判空:使用-z 字符串长度为0时,为真,-n字符串长度不为0,为…